Skip to content

stringifier is encoding inline <script> tags #29

Closed
@jonathanong

Description

@jonathanong
var parse5 = require('parse5')
var serializer = new parse5.Serializer
serializer.serialize({
  "nodeName": "#document-fragment",
  "quirksMode": false,
  "childNodes": [
    {
      "nodeName": "script",
      "tagName": "script",
      "attrs": [],
      "namespaceURI": "http://www.w3.org/1999/xhtml",
      "childNodes": [
        {
          "nodeName": "#text",
          "value": "function test(t,n){return t&&n}"
        }
      ]
    }
  ]
})

returns:

<script>function test(t,n){return t&amp;&amp;n}</script>

how do i avoid encoding the contents of the script tag?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions