-
-
Notifications
You must be signed in to change notification settings - Fork 34
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
Building a HB template with $CLASS$
text fails
#19
Comments
https://github.com/assemble/grunt-assemble/blob/master/tasks/assemble.js#L700 1 line change change |
@jonschlinkert's solution with @knight-dj-et if you'd like to do a PR, that'd be awesome! |
well, it's not about faster here. it's only useful if we want to replace multiple occurrences of |
but yes, it's also considerably faster |
wait, why would we do |
Oh. I suppose I did it too broadly. It should replace any $ followed by a |
we would need to do something like this: var injectBody = function(layout, body) {
body = body.split('$').join('___ESC_DOLLAR__');
var res = layout.replace(assemble.engine.bodyRegex, body);
return res.split('___ESC_DOLLAR__').join('$');
}; edited... |
the other alternative is to just do split/join on the actual body tag. IMO that's a better way to go. since : 1) a user would expect any tag to yield the same result if it was used more than once in a string, 2) it would only do the split/join operation once, whereas the escaping approach ends up doing it three times (including |
All we need to do is |
^ what he said lol |
@doowb you said that earlier and I missed the function part of the replacement... |
fixed in |
moved from assemble/assemble#580 (comment)
The text was updated successfully, but these errors were encountered: