Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-8901

WYSIWYG editor turns <BR/> into <BR></BR> inside HTML macro

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Low Low
    • 4.0
    • 2.5.4
    • None
    • Standalone 2.4.5 Confluence, JDK 1.4.2_14

      I enabled the html macro for my personal site. On a page I used this macro from the WYSIWYG editor to insert some HTML that included several <BR/> tags. That tag is correctly-formatted XHTML, in the sense that it doesn't leave any open XML tags lying around. However, the WYSIWYG editor doesn't seem to like it: when I opened the page in the WYSIWYG editor again, the tag had changed to <BR></BR> which is wrong. FireFox 2.0.0.3 (at least) renders <BR></BR> as two separate line breaks, which isn't what I wanted.

      Some more experimentation showed that the problem seems to be in the module that transforms Wiki markup into HTML on the way into the WYSIWYG editor: editing the page with the Wiki Markup editor set as the default shows the original <BR/> tag, but then switching to the WYSIWYG editor shows the new (wrong) <BR></BR> pair.

      HOW TO REPRODUCE:

      1. Set the Wiki Markup editor as your default.
      2. Enable the HTML macro.
      3. Edit a page and insert this text, but change the parens to braces:
      (html)
      First line<BR/>
      second line
      (html)

      4. Save this page and view it. You will see just one line between "first line" and "second line."
      5. Edit the page (in the Wiki Markup editor). You will see no change - the original <BR/> tag is there.
      6. Switch to the WYSIWYG editor. Now you will see that the tag has changed to <BR></BR> which is not correct.
      7. Save the page from the WYSIWYG editor and view it. Under FireFox 2.0.0.3 (at least) you will see a blank line between "First line" and "second line" which isn't what I wanted.

      This bug probably applies to all sorts of XHTML that uses the <tag/> syntax to open and close a tag in a single XML element. For some of them it's harmless but for <BR/> it changes the rendering in at least one browser.

              smansour Sherif Mansour
              5536221ed75d Allan Pratt
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: