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

Disable escaping when rendering view as text/plain #654

Closed
sorbits opened this issue Aug 1, 2014 · 0 comments
Closed

Disable escaping when rendering view as text/plain #654

sorbits opened this issue Aug 1, 2014 · 0 comments

Comments

@sorbits
Copy link

sorbits commented Aug 1, 2014

When calling render on a View or Preview object and giving a text/plain mime-type then I don’t see a need for HTML escaping.

Right now we need to manually disable it, e.g.:

$f3->set('ESCAPE', false);
$text = Preview::instance()->render($template, 'text/plain');
$f3->set('ESCAPE', true);

I request that escaping is enabled only when the mime-type matches the following regular expression: ^(text/html|(application|text)/(.+\+)?xml)$.

If there is agreement I can submit a PR.

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

No branches or pull requests

3 participants