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

Not HTML escaped interpolation #34

Open
unirgy opened this issue May 28, 2013 · 2 comments
Open

Not HTML escaped interpolation #34

unirgy opened this issue May 28, 2013 · 2 comments
Labels

Comments

@unirgy
Copy link

unirgy commented May 28, 2013

Is it possible to have non-escaped output from interpolation, for example within :javascript filter?

:javascript
     var data = #{$json};
@unirgy
Copy link
Author

unirgy commented May 29, 2013

I've tried to get access to $node->getEscaping(), but apparently $node is very different between RendererAbstract and PhpRenderer, so I was able to implement it by adding (BApp::set/get - global registry)

MtHaml/NodeVisitor/RendererAbstract.php:

302: \BApp::set('BHAML/disable_escaping', true);
326: \BApp::set('BHAML/disable_escaping', false);

MtHaml/NodeVisitor/PhpRenderer.php:

56:  if (!\BApp::get('BHAML/disable_escaping') && $node->getEscaping()->isEnabled()) {

@alexby
Copy link

alexby commented Apr 15, 2017

I just faced the same problem, and looks like the goal could be reached by using TagAttributeInterpolation, but I have no idea how to work with it(the project has poor documentation in the code). Does anybody can help with it?

If you show me I wrong about TagAttributeInterpolation I will make a Pull Request with that feature (like attribute "force_escape=false" in attributes list means disable htmlspecialchars).

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

No branches or pull requests

3 participants