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

|truncate directive acts on escaped content, but should act on pre-escaped content #8

Closed
hitsthings opened this issue Aug 12, 2014 · 2 comments

Comments

@hitsthings
Copy link

{'12"45"'|truncate:6} is printed as 12&... because it acts on the expanded HTMl entities like "
{'12"45"'|truncate:6|escapeHtml} forces ordering and is printed as 12"45" (the HTML source is 12"45")

I can't see the usefulness of acting on the escaped HTML and it causes artifacts (like ampersands) to appear in your output HTML, so the latter behavior seems more sane by default.

@ghost
Copy link

ghost commented Oct 9, 2014

I've been bitten by this too, would love to see a fix. Thanks for the workaround, the one I thought of was clunkier (assign the truncated, non-escaped output to a variable first).

@Ubehebe
Copy link
Contributor

Ubehebe commented Jan 21, 2015

This does seem like surprising behavior. If you can change it and keep all the existing tests passing, send a PR.

Ubehebe pushed a commit that referenced this issue Feb 20, 2015
Support for IfNodes as traditional conditionals and ternary expressions where possible.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=86653446
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

No branches or pull requests

3 participants