unable to insert raw content into script tag
See original GitHub issuethe documentation (https://github.com/kotlin/kotlinx.html/wiki/Style-and-script-tags) says that it should be possible to insert raw content into a script tag.
This does not seem to work if I’m using the createHTMLDocument builder as then the inserted “raw” content needs to be valid XML. The example below causes a SAXParseException.
val html = createHTMLDocument().body {
script(type = ScriptType.textJScript) {
unsafe {
raw("""
function my() {return 1;}
""")
}
}
}.serialize(true)
Is this intended?
I also setup a sample project to demonstrate the issue: https://github.com/abendt/kotlin-html-jscript/blob/master/src/test/kotlin/HtmlScriptTest.kt
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
How to tell if a <script> tag failed to load - Stack Overflow
This solution works in my testing, as long as the script tag is placed directly in the document source. The document's onload event...
Read more >Run commands on your Windows instance at launch
Learn how to run commands on your Windows instances at launch. ... <script> tag was provided.. running script content – If the script...
Read more >Components - Astro Documentation
Astro components support adding client-side interactivity using standard HTML <script> tags. Scripts can be used to add event listeners, send analytics data, ...
Read more >How to Add Custom JavaScript to Your WordPress Site
Even though the easiest way to add a custom script to your WordPress site is by dropping a <script> tag directly into either...
Read more >html2pdf.js | Client-side HTML-to-PDF rendering using pure JS.
3” in npm, or use cdnjs for HTML script tags). Table of contents. Getting started. CDN; Raw JS; NPM; Bower; Console. Usage. Advanced...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Fixed in 0.6.10
yes, can confirm.
thanks!