Class InlineBodyMacroFixingTransformer

  • All Implemented Interfaces:
    Transformer

    public class InlineBodyMacroFixingTransformer
    extends Object
    implements Transformer
    Responsible for cleaning up cursor target paragraphs and moving <ac:macro> fragments that output inline markup when rendered, into any nearby paragraphs. Cursor targets get added by the tinymce-editor and now need to be persisted to the confluence storage format in a shared-drafts world for data consistency reasons as Synchrony will contain these cursor targets in it's format (editor format). A cursor target is a <p> tag that has the class auto-cursor-target and only contains either a <br/> or a &nbsp; the exact shape this will take depends on the browser the user is using and the action they are performing. (see confcursortarget/editor_plugin_src.js)

    For example:

     <p class="auto-cursor-target"><br/><p>
     <p>foo<p>
     <ac:macro ac:name="highlight">
          <ac:parameter ac:name="atlassian-macro-output-type">INLINE</ac:parameter>
     </ac:macro>
     
    To:
     <p>foo
     <ac:macro ac:name="highlight">
          <ac:parameter ac:name="atlassian-macro-output-type">INLINE</ac:parameter>
     </ac:macro>
     </p>
     

    A user can mark a macro as one that outputs INLINE markup by toggling the INLINE button. This will set a macro parameter named atlassian-macro-output-type to the value Macro.OutputType.INLINE.

    This transformer will only target <ac:macro> fragments that have this property.

    Since:
    4.0