Top Description Methods
com.vladsch.flexmark.html2md.converter

public Interface HtmlNodeConverterContext

extends NodeContext<Node, HtmlNodeConverterContext>
Known Direct Implementers
com.vladsch.flexmark.html2md.converter.HtmlNodeConverterSubContext, com.vladsch.flexmark.html2md.converter.FlexmarkHtmlConverter.MainHtmlConverter.SubHtmlNodeConverter
Imports
com.vladsch.flexmark.ast.Reference, com.vladsch.flexmark.html.renderer.LinkType, .ResolvedLink, com.vladsch.flexmark.util.data.DataHolder, com.vladsch.flexmark.util.format.NodeContext, com.vladsch.flexmark.util.html.Attributes, com.vladsch.flexmark.util.sequence.LineAppendable, com.vladsch.flexmark.util.sequence.builder.ISequenceBuilder, org.jetbrains.annotations.NotNull, .Nullable, org.jsoup.nodes.Document, .Node, java.util.HashMap, .HashSet, .Stack

The context for node rendering, including configuration and functionality for the node renderer to use.

Method Summary

Modifier and TypeMethod and Description
public void
public void
public @NotNull String
public void
public @Nullable Node

Returns:

the current node being rendered
getCurrentNode
()

Redeclares com.vladsch.flexmark.util.format.NodeContext.getCurrentNode.

public @NotNull Document

Returns:

the Document node of the current context
getDocument
()

public @NotNull HashSet<Reference>
public Document

Returns:

the com.vladsch.flexmark.util.ast.Document node of the current context
getForDocument
()

public HtmlConverterPhase

Returns:

current rendering phase
getFormattingPhase
()

public @NotNull HtmlConverterOptions

Returns:

the HtmlConverterOptions for the context.
getHtmlConverterOptions
()

public HtmlMarkdownWriter

Returns:

the LineAppendable writer to use
getMarkdown
()

public @NotNull DataHolder

Returns:

the current renderer options DataHolder
getOptions
()

Redeclares com.vladsch.flexmark.util.format.NodeContext.getOptions.

Get the current rendering context DataHolder.

public @Nullable Reference
public @NotNull HashMap<String, Reference>
public @NotNull HashMap<String, Reference>
public @Nullable HtmlConverterState
public @NotNull Stack<HtmlConverterState>
public @NotNull HtmlNodeConverterContext

Returns:

a new rendering context with a given appendable for its output
getSubContext
()

Redeclares com.vladsch.flexmark.util.format.NodeContext.getSubContext.

Creates a child rendering context that can be used to collect rendered html text.

public @NotNull HtmlNodeConverterContext

Returns:

a new rendering context with a given appendable for its output
getSubContext
(@Nullable DataHolder
options to use for the context (only options which do not affect the context construction will be used)
options
)

Creates a child rendering context that can be used to collect rendered html text.

public @NotNull HtmlNodeConverterContext

Returns:

a new rendering context with a given appendable for its output
getSubContext
(@Nullable DataHolder
options to use for the context (only options which do not affect the context construction will be used)
options
,
@NotNull ISequenceBuilder<?, ?>
sequence builder to user for appended text for tracking original base offsets
builder
)

Creates a child rendering context that can be used to collect rendered html text.

public void
inlineCode(@NotNull Runnable inlineRunnable)

public boolean
public boolean
public @Nullable Node
next()

public @Nullable Node
next(int skip)

public int
public Node
public @Nullable Node
peek()

public @Nullable Node
peek(int skip)

public void
public @NotNull String
public @NotNull String
prepareText(@NotNull String text, boolean inCode)

public void
public void
public void
processTextNodes(@NotNull Node node, boolean stripIdAttribute)

public void
processTextNodes(@NotNull Node node, boolean stripIdAttribute, @NotNull CharSequence wrapText)

public void
processTextNodes(@NotNull Node node, boolean stripIdAttribute, @Nullable CharSequence textPrefix, @Nullable CharSequence textSuffix)

public @NotNull String
public void
public void
processWrapped(@NotNull Node node, @Nullable Boolean isBlock, boolean escapeMarkdown)

public void
public void
render(@NotNull Node
the node to render
node
)

Render the specified node and its children using the configured renderers.

public void
renderChildren(@NotNull Node
node the children of which are to be rendered
parent
,
boolean
true if attributes should be output
outputAttributes
,
@Nullable Runnable
runnable to run before popping state
prePopAction
)

Render the children of the node, used by custom renderers

public void
public void
setInlineCode(boolean inlineCode)

public void
setTrace(boolean trace)

public void
skip()

public void
skip(int skip)

public void
public void
public void
public void
wrapTextNodes(@NotNull Node node, @NotNull CharSequence wrapText, boolean needSpaceAround)

Inherited from com.vladsch.flexmark.util.format.NodeContext:
getSubContextgetSubContext

Method Detail

appendOuterHtmlback to summary
public void appendOuterHtml(@NotNull Node node)
delegateRenderback to summary
public void delegateRender()
escapeSpecialCharsback to summary
public @NotNull String escapeSpecialChars(@NotNull String text)
Annotations
@NotNull
excludeAttributesback to summary
public void excludeAttributes(String... excludes)
getCurrentNodeback to summary
public @Nullable Node getCurrentNode()

Redeclares com.vladsch.flexmark.util.format.NodeContext.getCurrentNode.

Returns:@Nullable Node

the current node being rendered

Annotations
@Nullable
getDocumentback to summary
public @NotNull Document getDocument()
Returns:@NotNull Document

the Document node of the current context

Annotations
@NotNull
getExternalReferencesback to summary
public @NotNull HashSet<Reference> getExternalReferences()
Annotations
@NotNull
getForDocumentback to summary
public Document getForDocument()
Returns:Document

the com.vladsch.flexmark.util.ast.Document node of the current context

Annotations
@Nullable
getFormattingPhaseback to summary
public HtmlConverterPhase getFormattingPhase()
Returns:HtmlConverterPhase

current rendering phase

getHtmlConverterOptionsback to summary
public @NotNull HtmlConverterOptions getHtmlConverterOptions()
Returns:@NotNull HtmlConverterOptions

the HtmlConverterOptions for the context.

Annotations
@NotNull
getMarkdownback to summary
public HtmlMarkdownWriter getMarkdown()
Returns:HtmlMarkdownWriter

the LineAppendable writer to use

getOptionsback to summary
public @NotNull DataHolder getOptions()

Redeclares com.vladsch.flexmark.util.format.NodeContext.getOptions.

Get the current rendering context DataHolder. These are the options passed or set on the FlexmarkHtmlConverter#builder() or passed to FlexmarkHtmlConverter#builder(DataHolder). To get the document options you should use getDocument() as the data holder.

Returns:@NotNull DataHolder

the current renderer options DataHolder

Annotations
@NotNull
getOrCreateReferenceback to summary
public @Nullable Reference getOrCreateReference(@NotNull String url, @NotNull String text, @Nullable String title)
Annotations
@Nullable
getReferenceIdToReferenceMapback to summary
public @NotNull HashMap<String, Reference> getReferenceIdToReferenceMap()
Annotations
@NotNull
getReferenceUrlToReferenceMapback to summary
public @NotNull HashMap<String, Reference> getReferenceUrlToReferenceMap()
Annotations
@NotNull
getStateback to summary
public @Nullable HtmlConverterState getState()
Annotations
@Nullable
getStateStackback to summary
public @NotNull Stack<HtmlConverterState> getStateStack()
Annotations
@NotNull
getSubContextback to summary
public @NotNull HtmlNodeConverterContext getSubContext()

Redeclares com.vladsch.flexmark.util.format.NodeContext.getSubContext.

Creates a child rendering context that can be used to collect rendered html text. The child context inherits everything but the HtmlRenderer and doNotRenderLinksNesting from the parent.

Returns:@NotNull HtmlNodeConverterContext

a new rendering context with a given appendable for its output

Annotations
@NotNull
getSubContextback to summary
public @NotNull HtmlNodeConverterContext getSubContext(@Nullable DataHolder options)

Creates a child rendering context that can be used to collect rendered html text. The child context inherits everything but the HtmlRenderer and doNotRenderLinksNesting from the parent.

Parameters
options:@Nullable DataHolder

options to use for the context (only options which do not affect the context construction will be used)

Returns:@NotNull HtmlNodeConverterContext

a new rendering context with a given appendable for its output

Annotations
@NotNull
getSubContextback to summary
public @NotNull HtmlNodeConverterContext getSubContext(@Nullable DataHolder options, @NotNull ISequenceBuilder<?, ?> builder)

Creates a child rendering context that can be used to collect rendered html text. The child context inherits everything but the HtmlRenderer and doNotRenderLinksNesting from the parent.

Parameters
options:@Nullable DataHolder

options to use for the context (only options which do not affect the context construction will be used)

builder:@NotNull ISequenceBuilder<?, ?>

sequence builder to user for appended text for tracking original base offsets

Returns:@NotNull HtmlNodeConverterContext

a new rendering context with a given appendable for its output

Annotations
@NotNull
inlineCodeback to summary
public void inlineCode(@NotNull Runnable inlineRunnable)
isInlineCodeback to summary
public boolean isInlineCode()
isTraceback to summary
public boolean isTrace()
nextback to summary
public @Nullable Node next()
Annotations
@Nullable
nextback to summary
public @Nullable Node next(int skip)
Annotations
@Nullable
outputAttributesback to summary
public int outputAttributes(@NotNull LineAppendable out, @NotNull String initialSep)
parseMarkdownback to summary
public Node parseMarkdown(@NotNull String markdown)
Annotations
@NotNull
peekback to summary
public @Nullable Node peek()
Annotations
@Nullable
peekback to summary
public @Nullable Node peek(int skip)
Annotations
@Nullable
popStateback to summary
public void popState(@Nullable LineAppendable out)
prepareTextback to summary
public @NotNull String prepareText(@NotNull String text)
Annotations
@NotNull
prepareTextback to summary
public @NotNull String prepareText(@NotNull String text, boolean inCode)
Annotations
@NotNull
processAttributesback to summary
public void processAttributes(@NotNull Node node)
processConditionalback to summary
public void processConditional(@NotNull ExtensionConversion extensionConversion, @NotNull Node node, @NotNull Runnable processNode)
processTextNodesback to summary
public void processTextNodes(@NotNull Node node, boolean stripIdAttribute)
processTextNodesback to summary
public void processTextNodes(@NotNull Node node, boolean stripIdAttribute, @NotNull CharSequence wrapText)
processTextNodesback to summary
public void processTextNodes(@NotNull Node node, boolean stripIdAttribute, @Nullable CharSequence textPrefix, @Nullable CharSequence textSuffix)
processTextNodesback to summary
public @NotNull String processTextNodes(@NotNull Node node)
Annotations
@NotNull
processUnwrappedback to summary
public void processUnwrapped(@NotNull Node element)
processWrappedback to summary
public void processWrapped(@NotNull Node node, @Nullable Boolean isBlock, boolean escapeMarkdown)
pushStateback to summary
public void pushState(@NotNull Node parent)
renderback to summary
public void render(@NotNull Node node)

Render the specified node and its children using the configured renderers. This should be used to render child nodes; be careful not to pass the node that is being rendered, that would result in an endless loop.

Parameters
node:@NotNull Node

the node to render

renderChildrenback to summary
public void renderChildren(@NotNull Node parent, boolean outputAttributes, @Nullable Runnable prePopAction)

Render the children of the node, used by custom renderers

Parameters
parent:@NotNull Node

node the children of which are to be rendered

outputAttributes:boolean

true if attributes should be output

prePopAction:@Nullable Runnable

runnable to run before popping state

renderDefaultback to summary
public void renderDefault(@NotNull Node node)
setInlineCodeback to summary
public void setInlineCode(boolean inlineCode)
setTraceback to summary
public void setTrace(boolean trace)
skipback to summary
public void skip()
skipback to summary
public void skip(int skip)
transferIdToParentback to summary
public void transferIdToParent()
transferToParentExceptback to summary
public void transferToParentExcept(String... excludes)
transferToParentOnlyback to summary
public void transferToParentOnly(String... includes)
wrapTextNodesback to summary
public void wrapTextNodes(@NotNull Node node, @NotNull CharSequence wrapText, boolean needSpaceAround)