Skip to content

unable to insert raw content into script tag #83

@abendt

Description

@abendt

the 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions