Skip to content

[RFC] For DOM children, use repr(MIME("text/html", x)) #12

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

Merged
merged 2 commits into from
May 28, 2019

Conversation

tshort
Copy link
Contributor

@tshort tshort commented May 28, 2019

With this change, HTML content can be nested inside Node's. This means a package user can include Markdown inside a node and have the HTML representation of that embedded. Likewise, a DataFrame will have its HTML representation included. Here is an example:

julia> using Hyperscript, Markdown

julia> m("div", md"# *Important* heading")
<div><div class="markdown"><h1><em>Important</em> heading</h1>
</div></div>

I'm not sure what the impact is on escaping. This branch passes tests locally.

@yurivish
Copy link
Collaborator

yurivish commented May 28, 2019

Thanks for the improvement, Tom! I think this looks good.

Re: escaping, I think the intention was always to protect against HTML content being injected through content that may be provided by user input. This change does mean that one can bypass the sanitization mechanism with a custom type if that type represents user input and implements HTML escaping incorrectly, but I don't think there's any principled way to prevent that other than fixing the bug in the source package.

Thank you for the contribution!

@yurivish yurivish merged commit 1d58673 into JuliaWeb:master May 28, 2019
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