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

Don't encode ShapeStringify #7503

Merged
merged 1 commit into from
Nov 5, 2020
Merged

Don't encode ShapeStringify #7503

merged 1 commit into from
Nov 5, 2020

Conversation

jtkech
Copy link
Member

@jtkech jtkech commented Nov 3, 2020

Fixes #7497

shape_stringify should return a string, that's why i did #7463, but should not be marked to be encoded again as it is the representation of a shape, so normally already encoded

E.g. shape_render return an HtmlContentValue holding a ViewBuffer whose WriteTo() doesn't encode again

I think there are other filters that wrongly return a string marked to be encoded, i'm thinking about those that generate urls, maybe currently it works because the browser is aware of this and html decodes them before url encoding them.

Update:

So the filters that would need to return a string no to be html encoded aqain, are those that return a string that is intended to be already encoded, or intended to be encoded differently, e.g. url encoded for an url in an href.

Seems okay for filters that generate urls as the strings are first url encoded by the filters, so most of the time html encoding an url encoded string does nothing, maybe not in all cases but again seems that the browser is aware of this.

Notice that for urls sometimes we want to also display them as texts, so here we would need strings that are not url encoded but only html encoded, but we would need 2 sets of filters, one for links and one for display values ;)

But there are other candidates, that would need to not mark their StringValue to be encoded again, as the sanitize_html and markdownify filters and so on, so that we don't need to add on them a | raw filter.

@jtkech jtkech merged commit 2effa6f into dev Nov 5, 2020
@delete-merged-branch delete-merged-branch bot deleted the jtkech/unencodedStringify branch November 5, 2020 03:32
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.

Wrong html entities in <title> tag after PR 7463
1 participant