Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parse error when tags are in a certain order #42

Open
rmurphey opened this issue Jul 1, 2011 · 5 comments
Open

Parse error when tags are in a certain order #42

rmurphey opened this issue Jul 1, 2011 · 5 comments
Assignees

Comments

@rmurphey
Copy link

rmurphey commented Jul 1, 2011

I have the following template:

.component.video-player
  :if !useHtml5Player
    .play-button{ dojoAttachPoint : 'playButton' }
    %img.poster{ src : poster, dojoAttachPoint : "videoPlaceholder" }

  .backdrop{ dojoAttachPoint : 'backdrop' }

And it results in the following error:

with(locals || {}) {
  try {
   var _$output="<div class=\"component video-player\">" + 
(function () { if (!useHtml5Player) { return (
"<div dojoAttachPoint=\"" + html_escape('playButton') + "\" class=\"play-button\">" + 
"</div>"
"<img src=\"" + html_escape(poster) + "\" dojoAttachPoint=\"videoPlaceholder\" class=\"poster\" />"
);} else { return ""; } }).call(this) +
"<div dojoAttachPoint=\"" + html_escape('backdrop') + "\" class=\"backdrop\">" + 
"</div></div>";
 return _$output;  } catch (e) {
    return "\n<pre class='error'>" + html_escape(e.stack) + "</pre>\n";
  }
}

The issue is that there is no "+" after the play-button div string; however, if I put the img before that div, then everything works fine. I'm having a hard time tracking down where in the code this is getting assembled, any help would be welcome :)

@creationix
Copy link
Owner

I haven't looked at this code in a long time. I'll try and see if it's an easy fix.

Also just curious, is this for client-side templating or are you generating it server-side with node or something?

If client-side and haml-js is causing trouble and you're not married to the idea of text-based templating, then https://github.com/creationix/dombuilder is really simple and fun.

@ghost ghost assigned aaronblohowiak Jul 1, 2011
@creationix
Copy link
Owner

Oops, sorry, I forgot that @aaronblohowiak is helping with this project. I'll still try to dig into the issue, but today is very busy for me today because of our product launch. Aaron, don't wait on me to diagnose the issue.

@rmurphey
Copy link
Author

rmurphey commented Jul 1, 2011

This is actually for client-side templating in a PhoneGap project with Dojo -- we're replacing the very basic Dojo templating with Haml instead. I don't think dombuilder would be a good fit for us for this, but I'll definitely check it out :)

@aaronblohowiak
Copy link
Collaborator

I am away from keyboard until July 7th, can investigate then.

On Jul 1, 2011, at 10:32 AM, [email protected] wrote:

Oops, sorry, I forgot that @aaronblohowiak is helping with this project. I'll still try to dig into the issue, but today is very busy for me today because of our product launch. Aaron, don't wait on me to disgnose the issue.

Reply to this email directly or view it on GitHub:
#42 (comment)

@aaronblohowiak
Copy link
Collaborator

Sorry for the delay, I am going to look into this during the next few days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants