You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Follow-on to #2154: Pasting HTML and converting it to Hiccup doesn't correctly convert <script> or <style> tags that contain inline contents.
Paste this HTML into a Clojure file:
<!DOCTYPE html><htmllang="en"><head><metacharset="UTF-8"/><title>Sparkfund Email</title><styletype="text/css">.example { color: red; }</style><scripttype="text/javascript">alert('hello?');</script></head><body><p>The content of the style and script tags is dropped.</p><styletype="text/css">.example { color: red; }</style><scripttype="text/javascript">alert('hello?');</script><pre>
What about the humble pre tag?
which can have text on multiple lines?
</pre><textarea>And textareas?</textarea><foo>Or custom tags?</foo></body></html>
Accept the option to convert to Hiccup:
The resulting Hiccup is incorrect because it has lost the contents of the <script> and <style> tags:
[:html {:lang"en"}
[:head
[:meta {:charset"UTF-8"}]
[:title"Sparkfund Email"]
[:style {:type"text/css"}]
[:script {:type"text/javascript"}]]
[:body
[:p"The content of the style and script tags is dropped."]
[:style {:type"text/css"}]
[:script {:type"text/javascript"}]
[:pre"What about the humble pre tag? which can have text on multiple lines?"]
[:textarea"And textareas?"]
[:foo"Or custom tags?"]]]
This also happens in the case of isolated fragments, e.g.
<script>alert("test");</script>
converts to just [:script].
This is in Cursive v1.8.2-eap2-2018.3 and IDEA Ultimate 2018.3.6.
The text was updated successfully, but these errors were encountered:
Thanks for the report - I suspect this is because those fragments are embedded languages. I'll check what I need to do to fix this. I wonder about the pre tag too, I'll think about that.
This is fixed for the next build, including a fix so that pre maintains its whitespace:
[:html {:lang"en"}
[:head
[:meta {:charset"UTF-8"}]
[:title"Sparkfund Email"]
[:style {:type"text/css"} ".example { color: red; }"]
[:script {:type"text/javascript"} "alert('hello?');"]]
[:body
[:p"The content of the style and script tags is dropped."]
[:style {:type"text/css"} ".example { color: red; }"]
[:script {:type"text/javascript"} "alert('hello?');"]
[:pre" What about the humble pre tag? which can have text on multiple lines?"]
[:textarea"And textareas?"]
[:foo"Or custom tags?"]]]
Follow-on to #2154: Pasting HTML and converting it to Hiccup doesn't correctly convert
<script>
or<style>
tags that contain inline contents.Paste this HTML into a Clojure file:
Accept the option to convert to Hiccup:
The resulting Hiccup is incorrect because it has lost the contents of the
<script>
and<style>
tags:This also happens in the case of isolated fragments, e.g.
converts to just
[:script]
.This is in Cursive v1.8.2-eap2-2018.3 and IDEA Ultimate 2018.3.6.
The text was updated successfully, but these errors were encountered: