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

script tag rejects valid javascript due to external #32

Open
negatratoron opened this issue Nov 7, 2017 · 0 comments
Open

script tag rejects valid javascript due to external #32

negatratoron opened this issue Nov 7, 2017 · 0 comments

Comments

@negatratoron
Copy link

negatratoron commented Nov 7, 2017

As you know, style and script tags apply the external function to their content, which here causes the content to be wiped if it contains the "</" characters.

First of all, it would be awesome if these docs mentioned that this happens, since I was very confused about why my input was getting eaten.

Second of all, as-is this appears to be a bug, not a feature, since it rejects perfectly valid javascript code, such as document.write("<p>hello</p>") because that code contains the substring </.

This seems to be a functioning workaround:

script :: String -> Html
script str = preEscapedToHtml ("<script>" ++ str ++ "</script>")
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

1 participant