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

Add (simple) {% raw %} implementation... #69

Merged
merged 1 commit into from
Mar 18, 2013
Merged

Conversation

m0ppers
Copy link
Contributor

@m0ppers m0ppers commented Mar 17, 2013

Well...this is really a simple implementation ;) however it works and not having {% raw %} at hand really drives me mad as my templates contain angularjs code. Currently my workaround is

{{ '{{' }} angular.var {{ '}}' }}

The only real problem with my implementation i see (i might of course be missing something ;) ) is that you have to type {% raw %} EXACTLY like this. Otherwise the parsing must be changed to support regexes for the tokens.

@justjohn
Copy link
Collaborator

Looks like a good first implementation to me. Aside from the whitespace issue you mention, it may be possible to create a template with "{% raw %}" and "{% endraw %}" in strings that might break, but it's enough of an edge case that I don't think it's likely to affect anyone.

Thanks for the contribution!

justjohn added a commit that referenced this pull request Mar 18, 2013
Add (simple) {% raw %} implementation...
@justjohn justjohn merged commit f9cc523 into twigjs:master Mar 18, 2013
@justjohn justjohn mentioned this pull request Apr 10, 2013
This pull request was closed.
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.

2 participants