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

Mu fails when using new lines and HTML tags #23

Closed
mlegenhausen opened this issue Mar 22, 2012 · 2 comments
Closed

Mu fails when using new lines and HTML tags #23

mlegenhausen opened this issue Mar 22, 2012 · 2 comments

Comments

@mlegenhausen
Copy link

Example:

Working:

<b>{{foo}}</b>

Fails:

<b>
{{foo}}
</b>

Exception:

/node_modules/mu2/lib/mu/parser.js:95
      throw new Error('Encountered an unclosed tag: "' + this.otag + this.buff
            ^
__MU_NEWLINE__</b>"an unclosed tag: "{{foo}}
    at Object.scanTag (/node_modules/mu2/lib/mu/parser.js:95:13)
    at Object.tokenize (/node_modules/mu2/lib/mu/parser.js:29:56)
    at Object.parse (/node_modules/mu2/lib/mu/parser.js:9:17)
    at /node_modules/mu2/lib/mu.js:37:21
    at [object Object].<anonymous> (fs.js:115:5)
    at [object Object].emit (events.js:64:17)
    at afterRead (fs.js:1117:12)
    at Object.wrapper [as oncomplete] (fs.js:254:17)

When looking in your examples there are no examples where you use newlines when working with tags, but I think this is a normal usage of HTML?

@mlegenhausen
Copy link
Author

Ok I find out why. Cause you only replace \n with __MU_NEWLINE__ but not \r\n. Thats also why the exception output is damaged.

@raycmorgan
Copy link
Owner

Should be fixed in d81fef3

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

2 participants