Uploaded image for project: 'Confluence Server and Data Center'
  1. Confluence Server and Data Center
  2. CONFSERVER-9929

Rich Text Editor handling of macros with body markup is buggy and/or incomplete

    XMLWordPrintable

    Details

      Description

      It is currently impossible for macros which have a body that contains wiki markup to be correctly rendered or converted when switching between RichText and wiki markup editing. For example, the {toc-zone} macro generates a table of contents for all headings contained within it's body. However, when it's contents are viewed in the RTE bad stuff happens. Here are the options, with all possible combinations of the 'supressMacroRenderingDuringyWysiwyg' ('Macro Rendering') and 'suppressSurroundingTagDuringWysiwygRendering' ('Surrounding Tag') methods:

      Suppress Macro Rendering Suppress Surrounding Tag Result
      false false All content is unrendered and wiki markup for the {toc-zone} is displayed. Eg. 'h1.' displays as 'h1.', not a pretty heading. Not what I would expect.
      true false All content is unrendered and wiki markup for the {toc-zone} is displayed.
      true true All content is rendered and wiki markup for the {toc-zone} is suppressed. Additionally, once you switch to and from RTE mode, or save, the original {toc-zone} markup is lost, and will no longer dynamically update. Not only that, but the hard-coded markup will loose it's links also. Not exactly what I had in mind.
      false true All content is rendered and wiki markup for the {toc-zone} is suppressed. However, as above, switching between RTE and wiki mode will corrupt the page irretrievably.

      Essentially, it seems that the 'Suppress Macro Rendering' option is not working as expected - it seems that 'Suppress Surrounding Tag' is the only flag which has any effect, and when enabled it will do both - either display the markup for everything or display the markup for nothing.

      In any case, I think that a better option would be to allow an option for macros to specify that the macro body to be rendered, rather than the whole macro. Some cases will still want the exiting options (if they actually worked, that is), but in the example of {toc-zone} it would be much more useful to be able to display the

      {toc-zone}

      macro itself, but have it's body markup rendered as per usual. As such, perhaps an extra option to 'suppressMacroBodyRenderingInWysywiyg' could be added, which will be trumped if the 'suppressMacroRenderingInWysiwiy' returns true.

      But even if that is not added, getting the other two flags to work correctly would help a lot...

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              smansour Sherif Mansour
              Reporter:
              david@randombits.org David Peterson
              Votes:
              10 Vote for this issue
              Watchers:
              11 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: