Saving a panel macro with a title containing quotes ( " " ) using Rich Text Editor causes error on save

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: Low
    • 3.0
    • Affects Version/s: 2.7, 2.8
    • Component/s: None
    • Environment:

      If the title of a panel macro contains two double-quotes then, a NullPointerException will usually be thrown when saving the page from the Rich Text Editor.

      Eg paste the following markup into the wiki editor, hit the Rich Text tab, and click save.

      example markup
      {panel:title="heading 1"}
      content
      {panel}
      

      This happens:

      stacktrace excerpt. Full version attached
      org.w3c.dom.DOMException: INVALID_CHARACTER_ERR: An invalid or illegal XML character is specified. 
      	at org.apache.xerces.dom.CoreDocumentImpl.createAttribute(Unknown Source)
      	at org.apache.html.dom.HTMLDocumentImpl.createAttribute(Unknown Source)
      	at org.apache.xerces.dom.ElementImpl.setAttribute(Unknown Source)
      	at org.cyberneko.html.parsers.DOMFragmentParser.startElement(DOMFragmentParser.java:431)
      	at org.cyberneko.html.filters.DefaultFilter.startElement(DefaultFilter.java:179)
      	at org.cyberneko.html.filters.NamespaceBinder.startElement(NamespaceBinder.java:286)
      	at org.cyberneko.html.HTMLTagBalancer.callStartElement(HTMLTagBalancer.java:1009)
      	at org.cyberneko.html.HTMLTagBalancer.startElement(HTMLTagBalancer.java:639)
      	at org.cyberneko.html.HTMLScanner$ContentScanner.scanStartElement(HTMLScanner.java:2407)
      	at org.cyberneko.html.HTMLScanner$ContentScanner.scan(HTMLScanner.java:1881)
      	at org.cyberneko.html.HTMLScanner.scanDocument(HTMLScanner.java:809)
      	at org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.java:478)
      	at org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.java:431)
      	at org.cyberneko.html.parsers.DOMFragmentParser.parse(DOMFragmentParser.java:164)
      	at com.atlassian.renderer.wysiwyg.DefaultWysiwygConverter.convertXHtmlToWikiMarkup(DefaultWysiwygConverter.java:947)
      

      Some variations fail in a slightly more bizarre way. The save succeeds but the macro is horribly munged.
      Eg

      example markup
      {panel:title="heading 1"}
      content
      {panel}
      

      If saved from the rich text editor leads to:

      munged markup
      {panel:title=
      content
      {null}
      

        1. stacktrace.txt
          12 kB
          Jason Schnell

              Assignee:
              Don Willis
              Reporter:
              Jason Schnell
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: