Class InlineBodyMacroFixingTransformer
- java.lang.Object
-
- com.atlassian.confluence.content.render.xhtml.storage.macro.inlinebody.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 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
-
-
Constructor Summary
Constructors Constructor Description InlineBodyMacroFixingTransformer(XmlOutputFactory xmlFragmentOutputFactory, XmlEventReaderFactory xmlEventReaderFactory, XMLEventFactoryProvider xmlEventFactoryProvider)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
transform(Reader input, ConversionContext conversionContext)
-
-
-
Constructor Detail
-
InlineBodyMacroFixingTransformer
public InlineBodyMacroFixingTransformer(XmlOutputFactory xmlFragmentOutputFactory, XmlEventReaderFactory xmlEventReaderFactory, XMLEventFactoryProvider xmlEventFactoryProvider)
-
-
Method Detail
-
transform
public String transform(Reader input, ConversionContext conversionContext) throws XhtmlException
- Specified by:
transform
in interfaceTransformer
- Returns:
- Throws:
XhtmlParsingException
- if there is a problem parsing the input parameter.XhtmlException
- for all other errors that may occur during transformation.
-
-