public class DefaultWysiwygConverter extends Object implements WysiwygConverter
| Modifier and Type | Field and Description |
|---|---|
static String |
CURSOR_PLACEMENT_CLASS
Class given to paragraphs whose purpose is to allow somewhere for the cursor to go after a macro.
|
static String |
CURSOR_PLACEMENT_PARAGRAPH
A Cursor placement paragraph provides a place to put the cursor after the final macro or table
on a page, or before the first macro or table on a page.
|
protected static boolean |
debug |
protected Set<String> |
macrosToIgnore
This contains a set of macro names which we don't add to the markup, because they are handled in other ways.
|
protected WikiStyleRenderer |
renderer |
static String |
TEXT_SEPARATOR |
static String |
TEXT_SEPERATOR
Deprecated.
use #TEXT_SEPARATOR
|
static String |
VALID_END |
static String |
VALID_START |
| Constructor and Description |
|---|
DefaultWysiwygConverter() |
DefaultWysiwygConverter(List<TextConverter> textConverterComponents) |
| Modifier and Type | Method and Description |
|---|---|
String |
convertChildren(NodeContext nodeContext)
Converts the children nodes of the given node in the node context to wiki markup.
|
String |
convertChildren(Node node,
Styles styles,
ListContext listContext,
boolean inTable,
boolean inListItem,
boolean ignoreText,
boolean escapeWikiMarkup,
Node previousSibling)
Deprecated.
Since 5.0. Use
convertChildren(NodeContext) instead. |
String |
convertNode(NodeContext nodeContext)
Converts the node in the given node context to wiki markup.
|
String |
convertWikiMarkupToXHtml(RenderContext ctx,
String wikiMarkup) |
String |
convertXHtmlToWikiMarkup(String xhtml) |
String |
getAttribute(Node node,
String name)
Deprecated.
As of release 4.1, use
NodeUtil.getAttribute(org.w3c.dom.Node, String). |
String |
getMacroInfoHtml(RenderContext context,
String name,
int xOffset,
int yOffset)
Deprecated.
This method seems unused in renderer and will probably be removed in a future version.
|
static String |
getRawChildText(Node node,
boolean stripNewlines)
Return the text content of a node, adding newlines for <br> and <p> tags
|
static String |
getRawChildTextWithoutReplacement(Node node)
Return the text content of a node, WITHOUT adding newlines for <br> and <p> tags
|
String |
getSep(Node previous,
String current,
boolean inTable,
boolean inList)
Deprecated.
Since 5.0. Use
getSeparator(String, NodeContext) instead. This method is quite broken
in 6.0 since it does not respect NodeContext.isInHeading(). |
String |
getSeparator(String current,
NodeContext nodeContext)
Determine the appropriate separation string to place between the wiki markup for the
previous node and the current node based on their type and the current table/list/heading
(etc.) context.
|
protected List<TextConverter> |
getTextConverterComponents()
Can be overridden to provide a different list of content escapers.
|
static boolean |
isUserNewline(Node node) |
void |
setIconManager(IconManager iconManager) |
void |
setMacroManager(MacroManager macroManager) |
void |
setWikiStyleRenderer(WikiStyleRenderer renderer) |
public static final String TEXT_SEPARATOR
public static final String TEXT_SEPERATOR
public static final String CURSOR_PLACEMENT_CLASS
public static final String CURSOR_PLACEMENT_PARAGRAPH
convertWikiMarkupToXHtml(RenderContext, String).protected static boolean debug
protected WikiStyleRenderer renderer
protected Set<String> macrosToIgnore
public static final String VALID_START
public static final String VALID_END
public DefaultWysiwygConverter()
public DefaultWysiwygConverter(List<TextConverter> textConverterComponents)
public void setWikiStyleRenderer(WikiStyleRenderer renderer)
public void setMacroManager(MacroManager macroManager)
public String getSeparator(String current, NodeContext nodeContext)
current - the "type" of the current node, see TypeBasedSeparationnodeContext - the current nodeContext.public String getSep(Node previous, String current, boolean inTable, boolean inList)
getSeparator(String, NodeContext) instead. This method is quite broken
in 6.0 since it does not respect NodeContext.isInHeading().getSep in interface WysiwygConverterpublic String convertChildren(NodeContext nodeContext)
WysiwygConverterconvertChildren in interface WysiwygConverterpublic String convertChildren(Node node, Styles styles, ListContext listContext, boolean inTable, boolean inListItem, boolean ignoreText, boolean escapeWikiMarkup, Node previousSibling)
convertChildren(NodeContext) instead.
It cascades the styles and nulls out the previous sibling before calling
convertChildren(Node, Styles, ListContext, boolean, boolean, boolean, boolean, Node).
convertChildren in interface WysiwygConverterpublic String convertNode(NodeContext nodeContext)
convertNode in interface WysiwygConverterpublic static boolean isUserNewline(Node node)
public static String getRawChildText(Node node, boolean stripNewlines)
node - the node to get the text content fromstripNewlines - if this is true then strip any newlines from the raw text, but still add newlines for br and p.public static String getRawChildTextWithoutReplacement(Node node)
node - the node to get the text content frompublic void setIconManager(IconManager iconManager)
public String getMacroInfoHtml(RenderContext context, String name, int xOffset, int yOffset)
getMacroInfoHtml in interface WysiwygConverterpublic String convertXHtmlToWikiMarkup(String xhtml)
convertXHtmlToWikiMarkup in interface WysiwygConverterpublic String convertWikiMarkupToXHtml(RenderContext ctx, String wikiMarkup)
convertWikiMarkupToXHtml in interface WysiwygConverterpublic String getAttribute(Node node, String name)
NodeUtil.getAttribute(org.w3c.dom.Node, String).getAttribute in interface WysiwygConverterprotected List<TextConverter> getTextConverterComponents()
Copyright © 2019 Atlassian. All rights reserved.