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

New lines are not handled properly in special attributes #535

Merged
merged 3 commits into from
Nov 11, 2013

Conversation

ccummings
Copy link
Contributor

When there is a new line character in the value of a specialAttribute like style, the getValue helper does not strip the leading and trailing quotes because the regex fails. Specifically the .* in the regex only matches non-newline characters.

So a mustache template like this will not set the styles properly.

<div style="height: {{height}};
width: {{width}};"></div>

@ccummings
Copy link
Contributor Author

Fix is to strip out new lines so the second regex passes.

We could have changed the regex (.* to [^]*) to match across new lines, but this would pass a value with a new line to the special attribute setter which may not behave properly in some browsers.

daffl added a commit that referenced this pull request Nov 11, 2013
New lines are not handled properly in special attributes
@daffl daffl merged commit dd60785 into master Nov 11, 2013
@daffl daffl deleted the specialAttr-newLine branch November 11, 2013 20:29
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

Successfully merging this pull request may close these issues.

None yet

2 participants