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

Macro parameter with open brace ({) character messes the Macro element in the page editor

    XMLWordPrintable

Details

    Description

      I am coding a Confluence macro for which I have overriden the default macro editor dialog to get my own. I have a single string parameter in which I would like to store a JSON structure so I can easily parse it when the macro is edited again.

      When doing so, after saving the macro, the macro element on the page editor does not behave properly. It should display the name of the Macro along with the parameters if I wish to display them. Instead the name is replaced with the first element of my JSON object and the parameter part is the rest of the JSON object (see attached image). Is there any trick besides changing my storage format and parsing by hand ?

      When I edit the macro again, I do receive the data correctly. It is only a display problem in the Page Editor.

      Here is my macro definition

      <xhtml-macro name="canalmetadata" label="Canal Metadata"
                     class="com.confluence.plugins.metadata.macros.CanalMetadataMacro"
                     key="canal-metadata.macro">
          <description key="canal-metadata-macro.description">The metadata selection macro</description>
          <category name="confluence-content"/>
          <parameters>
              <parameter name="metaselection" type="string" required="true">
                  <option key="showNameInPlaceholder" value="false"/>
                  <option key="showValueInPlaceholder" value="false"/>
              </parameter>
          </parameters>
        </xhtml-macro>
      

      Steps to reproduce:

      1. Add Column macro to a page
      2. Set Column width parameter to "{test"

      Expected behaviour: Macro element in the page editor should have title "Column | width = {test".
      Actual behaviour: Macro element in the page editor has title "test".

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              920d8db3161a Sebastien Delcoigne
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: