Uploaded image for project: 'XWiki Rendering'
  1. XWiki Rendering
  2. XRENDERING-721

Content of script tags should be ignored to avoid additional content being saved

    XMLWordPrintable

Details

    • Unknown
    • N/A
    • N/A
    • Pull Request accepted

    Description

      When parsing HTML content that contains script tags, currently the content of the script tag is converted into XWiki syntax. The following example test demonstrates that the XHTML parser considers content that is inside the HTML head inside a script tag as regular content. The parser should ignore all content in the head tag and also in general in script tags. Not ignoring them can cause issues when converting the HTML that is provided to CKEditor directly without filtering.

      .#-----------------------------------------------------
      .input|html/5.0
      .#-----------------------------------------------------
      <!DOCTYPE html>
      <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
        <head>
          <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
          <script id="numbered-headings-config" type="application/json">
            {
              "isActivated": false,
              "isActivatedOnParent": false
            }
          </script>
        </head>
        <body id="body" class="skin-flamingo viewbody main wiki-xwikispace-XWiki">
        </body>
      </html>
      .#-----------------------------------------------------
      .expect|xwiki/2.1
      .#-----------------------------------------------------
      /~*~*/
            {
              "isActivated": false,
              "isActivatedOnParent": false
            }
      
      /~*~*/
      

      Attachments

        Issue Links

          Activity

            People

              mleduc Manuel Leduc
              MichaelHamann Michael Hamann
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: