Class FlexmarkHtmlConverter.MainHtmlConverter.SubHtmlNodeConverter
java.lang.Object
com.vladsch.flexmark.html2md.converter.HtmlNodeConverterSubContext
com.vladsch.flexmark.html2md.converter.FlexmarkHtmlConverter.MainHtmlConverter.SubHtmlNodeConverter
- All Implemented Interfaces:
HtmlNodeConverterContext, NodeContext<org.jsoup.nodes.Node, HtmlNodeConverterContext>
- Enclosing class:
FlexmarkHtmlConverter.MainHtmlConverter
private class FlexmarkHtmlConverter.MainHtmlConverter.SubHtmlNodeConverter
extends HtmlNodeConverterSubContext
implements HtmlNodeConverterContext
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final FlexmarkHtmlConverter.MainHtmlConverterprivate final DataHolderFields inherited from class HtmlNodeConverterSubContext
markdown, myRenderingNode, renderingHandlerWrapper -
Constructor Summary
ConstructorsConstructorDescriptionSubHtmlNodeConverter(@NotNull FlexmarkHtmlConverter.MainHtmlConverter mainNodeRenderer, @NotNull HtmlMarkdownWriter out, @Nullable DataHolder options) -
Method Summary
Modifier and TypeMethodDescriptionvoidappendOuterHtml(@NotNull org.jsoup.nodes.Node node) void@NotNull StringescapeSpecialChars(@NotNull String text) voidexcludeAttributes(String... excludes) org.jsoup.nodes.Node@NotNull org.jsoup.nodes.Document@NotNull HtmlConverterOptions@NotNull DataHolderGet the current rendering contextDataHolder.getOrCreateReference(@NotNull String url, @NotNull String text, @Nullable String title) getState()@NotNull Stack<HtmlConverterState> @NotNull HtmlNodeConverterContextCreates a child rendering context that can be used to collect rendered html text.@NotNull HtmlNodeConverterContextgetSubContext(@Nullable DataHolder options) Creates a child rendering context that can be used to collect rendered html text.@NotNull HtmlNodeConverterContextgetSubContext(@Nullable DataHolder options, @NotNull ISequenceBuilder<?, ?> builder) Creates a child rendering context that can be used to collect rendered html text.voidinlineCode(@NotNull Runnable inlineRunnable) booleanbooleanisTrace()@Nullable org.jsoup.nodes.Nodenext()@Nullable org.jsoup.nodes.Nodenext(int skip) intoutputAttributes(@NotNull LineAppendable out, @NotNull String initialSep) @NotNull NodeparseMarkdown(@NotNull String markdown) @Nullable org.jsoup.nodes.Nodepeek()@Nullable org.jsoup.nodes.Nodepeek(int skip) voidpopState(@Nullable LineAppendable out) @NotNull StringprepareText(@NotNull String text) @NotNull StringprepareText(@NotNull String text, boolean inCode) voidprocessAttributes(@NotNull org.jsoup.nodes.Node node) voidprocessConditional(@NotNull ExtensionConversion extensionConversion, @NotNull org.jsoup.nodes.Node node, @NotNull Runnable processNode) @NotNull StringprocessTextNodes(@NotNull org.jsoup.nodes.Node node) voidprocessTextNodes(@NotNull org.jsoup.nodes.Node node, boolean stripIdAttribute) voidprocessTextNodes(@NotNull org.jsoup.nodes.Node node, boolean stripIdAttribute, @NotNull CharSequence wrapText) voidprocessTextNodes(@NotNull org.jsoup.nodes.Node node, boolean stripIdAttribute, @Nullable CharSequence textPrefix, @Nullable CharSequence textSuffix) voidprocessUnwrapped(@NotNull org.jsoup.nodes.Node element) voidprocessWrapped(@NotNull org.jsoup.nodes.Node node, @Nullable Boolean isBlock, boolean escapeMarkdown) voidpushState(@NotNull org.jsoup.nodes.Node parent) voidrender(@NotNull org.jsoup.nodes.Node node) Render the specified node and its children using the configured renderers.voidrenderChildren(@NotNull org.jsoup.nodes.Node parent, boolean outputAttributes, Runnable prePopAction) Render the children of the node, used by custom renderersvoidrenderDefault(@NotNull org.jsoup.nodes.Node node) @NotNull ResolvedLinkresolveLink(@NotNull LinkType linkType, @NotNull CharSequence url, Attributes attributes, Boolean urlEncode) @NotNull ResolvedLinkresolveLink(@NotNull LinkType linkType, @NotNull CharSequence url, Boolean urlEncode) voidsetInlineCode(boolean inlineCode) voidsetTrace(boolean trace) voidskip()voidskip(int skip) voidvoidtransferToParentExcept(String... excludes) voidtransferToParentOnly(String... includes) voidwrapTextNodes(@NotNull org.jsoup.nodes.Node node, @NotNull CharSequence wrapText, boolean needSpaceAround) Methods inherited from class HtmlNodeConverterSubContext
flushTo, flushTo, getMarkdown, getRenderingNode, setRenderingNodeMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface HtmlNodeConverterContext
getMarkdown
-
Field Details
-
myMainNodeRenderer
-
myOptions
-
-
Constructor Details
-
SubHtmlNodeConverter
SubHtmlNodeConverter(@NotNull @NotNull FlexmarkHtmlConverter.MainHtmlConverter mainNodeRenderer, @NotNull @NotNull HtmlMarkdownWriter out, @Nullable @Nullable DataHolder options)
-
-
Method Details
-
getOptions
Description copied from interface:HtmlNodeConverterContextGet the current rendering contextDataHolder. These are the options passed or set on theFlexmarkHtmlConverter.builder()or passed toFlexmarkHtmlConverter.builder(DataHolder). To get the document options you should useHtmlNodeConverterContext.getDocument()as the data holder.- Specified by:
getOptionsin interfaceHtmlNodeConverterContext- Specified by:
getOptionsin interfaceNodeContext<org.jsoup.nodes.Node, HtmlNodeConverterContext>- Returns:
- the current renderer options
DataHolder
-
getHtmlConverterOptions
- Specified by:
getHtmlConverterOptionsin interfaceHtmlNodeConverterContext- Returns:
- the
HtmlConverterOptionsfor the context.
-
getDocument
@NotNull public @NotNull org.jsoup.nodes.Document getDocument()- Specified by:
getDocumentin interfaceHtmlNodeConverterContext- Returns:
- the
Documentnode of the current context
-
getFormattingPhase
- Specified by:
getFormattingPhasein interfaceHtmlNodeConverterContext- Returns:
- current rendering phase
-
render
public void render(@NotNull @NotNull org.jsoup.nodes.Node node) Description copied from interface:HtmlNodeConverterContextRender 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.- Specified by:
renderin interfaceHtmlNodeConverterContext- Parameters:
node- the node to render
-
getCurrentNode
public org.jsoup.nodes.Node getCurrentNode()- Specified by:
getCurrentNodein interfaceHtmlNodeConverterContext- Specified by:
getCurrentNodein interfaceNodeContext<org.jsoup.nodes.Node, HtmlNodeConverterContext>- Returns:
- the current node being rendered
-
getSubContext
Description copied from interface:HtmlNodeConverterContextCreates 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.- Specified by:
getSubContextin interfaceHtmlNodeConverterContext- Specified by:
getSubContextin interfaceNodeContext<org.jsoup.nodes.Node, HtmlNodeConverterContext>- Returns:
- a new rendering context with a given appendable for its output
-
getSubContext
@NotNull public @NotNull HtmlNodeConverterContext getSubContext(@Nullable @Nullable DataHolder options) Description copied from interface:HtmlNodeConverterContextCreates 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.- Specified by:
getSubContextin interfaceHtmlNodeConverterContext- Specified by:
getSubContextin interfaceNodeContext<org.jsoup.nodes.Node, HtmlNodeConverterContext>- Parameters:
options- options to use for the context (only options which do not affect the context construction will be used)- Returns:
- a new rendering context with a given appendable for its output
-
getSubContext
@NotNull public @NotNull HtmlNodeConverterContext getSubContext(@Nullable @Nullable DataHolder options, @NotNull @NotNull ISequenceBuilder<?, ?> builder) Description copied from interface:HtmlNodeConverterContextCreates 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.- Specified by:
getSubContextin interfaceHtmlNodeConverterContext- Specified by:
getSubContextin interfaceNodeContext<org.jsoup.nodes.Node, HtmlNodeConverterContext>- Parameters:
options- options to use for the context (only options which do not affect the context construction will be used)builder- sequence builder to user for appended text for tracking original base offsets- Returns:
- a new rendering context with a given appendable for its output
-
renderChildren
public void renderChildren(@NotNull @NotNull org.jsoup.nodes.Node parent, boolean outputAttributes, Runnable prePopAction) Description copied from interface:HtmlNodeConverterContextRender the children of the node, used by custom renderers- Specified by:
renderChildrenin interfaceHtmlNodeConverterContext- Parameters:
parent- node the children of which are to be renderedoutputAttributes- true if attributes should be outputprePopAction- runnable to run before popping state
-
getForDocument
- Specified by:
getForDocumentin interfaceHtmlNodeConverterContext- Returns:
- the
Documentnode of the current context
-
resolveLink
@NotNull public @NotNull ResolvedLink resolveLink(@NotNull @NotNull LinkType linkType, @NotNull @NotNull CharSequence url, Boolean urlEncode) - Specified by:
resolveLinkin interfaceHtmlNodeConverterContext
-
resolveLink
@NotNull public @NotNull ResolvedLink resolveLink(@NotNull @NotNull LinkType linkType, @NotNull @NotNull CharSequence url, Attributes attributes, Boolean urlEncode) - Specified by:
resolveLinkin interfaceHtmlNodeConverterContext
-
pushState
public void pushState(@NotNull @NotNull org.jsoup.nodes.Node parent) - Specified by:
pushStatein interfaceHtmlNodeConverterContext
-
popState
- Specified by:
popStatein interfaceHtmlNodeConverterContext
-
processAttributes
public void processAttributes(@NotNull @NotNull org.jsoup.nodes.Node node) - Specified by:
processAttributesin interfaceHtmlNodeConverterContext
-
outputAttributes
public int outputAttributes(@NotNull @NotNull LineAppendable out, @NotNull @NotNull String initialSep) - Specified by:
outputAttributesin interfaceHtmlNodeConverterContext
-
transferIdToParent
public void transferIdToParent()- Specified by:
transferIdToParentin interfaceHtmlNodeConverterContext
-
transferToParentExcept
- Specified by:
transferToParentExceptin interfaceHtmlNodeConverterContext
-
transferToParentOnly
- Specified by:
transferToParentOnlyin interfaceHtmlNodeConverterContext
-
peek
@Nullable public @Nullable org.jsoup.nodes.Node peek()- Specified by:
peekin interfaceHtmlNodeConverterContext
-
peek
@Nullable public @Nullable org.jsoup.nodes.Node peek(int skip) - Specified by:
peekin interfaceHtmlNodeConverterContext
-
next
@Nullable public @Nullable org.jsoup.nodes.Node next()- Specified by:
nextin interfaceHtmlNodeConverterContext
-
skip
public void skip()- Specified by:
skipin interfaceHtmlNodeConverterContext
-
next
@Nullable public @Nullable org.jsoup.nodes.Node next(int skip) - Specified by:
nextin interfaceHtmlNodeConverterContext
-
skip
public void skip(int skip) - Specified by:
skipin interfaceHtmlNodeConverterContext
-
delegateRender
public void delegateRender()- Specified by:
delegateRenderin interfaceHtmlNodeConverterContext
-
getReferenceUrlToReferenceMap
- Specified by:
getReferenceUrlToReferenceMapin interfaceHtmlNodeConverterContext
-
getExternalReferences
- Specified by:
getExternalReferencesin interfaceHtmlNodeConverterContext
-
getOrCreateReference
public Reference getOrCreateReference(@NotNull @NotNull String url, @NotNull @NotNull String text, @Nullable @Nullable String title) - Specified by:
getOrCreateReferencein interfaceHtmlNodeConverterContext
-
parseMarkdown
- Specified by:
parseMarkdownin interfaceHtmlNodeConverterContext
-
processUnwrapped
public void processUnwrapped(@NotNull @NotNull org.jsoup.nodes.Node element) - Specified by:
processUnwrappedin interfaceHtmlNodeConverterContext
-
processWrapped
public void processWrapped(@NotNull @NotNull org.jsoup.nodes.Node node, @Nullable @Nullable Boolean isBlock, boolean escapeMarkdown) - Specified by:
processWrappedin interfaceHtmlNodeConverterContext
-
appendOuterHtml
public void appendOuterHtml(@NotNull @NotNull org.jsoup.nodes.Node node) - Specified by:
appendOuterHtmlin interfaceHtmlNodeConverterContext
-
isInlineCode
public boolean isInlineCode()- Specified by:
isInlineCodein interfaceHtmlNodeConverterContext
-
setInlineCode
public void setInlineCode(boolean inlineCode) - Specified by:
setInlineCodein interfaceHtmlNodeConverterContext
-
inlineCode
- Specified by:
inlineCodein interfaceHtmlNodeConverterContext
-
escapeSpecialChars
- Specified by:
escapeSpecialCharsin interfaceHtmlNodeConverterContext
-
prepareText
- Specified by:
prepareTextin interfaceHtmlNodeConverterContext
-
prepareText
- Specified by:
prepareTextin interfaceHtmlNodeConverterContext
-
processTextNodes
- Specified by:
processTextNodesin interfaceHtmlNodeConverterContext
-
excludeAttributes
- Specified by:
excludeAttributesin interfaceHtmlNodeConverterContext
-
processTextNodes
public void processTextNodes(@NotNull @NotNull org.jsoup.nodes.Node node, boolean stripIdAttribute) - Specified by:
processTextNodesin interfaceHtmlNodeConverterContext
-
processTextNodes
public void processTextNodes(@NotNull @NotNull org.jsoup.nodes.Node node, boolean stripIdAttribute, @NotNull @NotNull CharSequence wrapText) - Specified by:
processTextNodesin interfaceHtmlNodeConverterContext
-
processTextNodes
public void processTextNodes(@NotNull @NotNull org.jsoup.nodes.Node node, boolean stripIdAttribute, @Nullable @Nullable CharSequence textPrefix, @Nullable @Nullable CharSequence textSuffix) - Specified by:
processTextNodesin interfaceHtmlNodeConverterContext
-
wrapTextNodes
public void wrapTextNodes(@NotNull @NotNull org.jsoup.nodes.Node node, @NotNull @NotNull CharSequence wrapText, boolean needSpaceAround) - Specified by:
wrapTextNodesin interfaceHtmlNodeConverterContext
-
processConditional
public void processConditional(@NotNull @NotNull ExtensionConversion extensionConversion, @NotNull @NotNull org.jsoup.nodes.Node node, @NotNull @NotNull Runnable processNode) - Specified by:
processConditionalin interfaceHtmlNodeConverterContext
-
renderDefault
public void renderDefault(@NotNull @NotNull org.jsoup.nodes.Node node) - Specified by:
renderDefaultin interfaceHtmlNodeConverterContext
-
getState
- Specified by:
getStatein interfaceHtmlNodeConverterContext
-
isTrace
public boolean isTrace()- Specified by:
isTracein interfaceHtmlNodeConverterContext
-
setTrace
public void setTrace(boolean trace) - Specified by:
setTracein interfaceHtmlNodeConverterContext
-
getStateStack
- Specified by:
getStateStackin interfaceHtmlNodeConverterContext
-