Class FlexmarkHtmlConverter
java.lang.Object
com.vladsch.flexmark.html2md.converter.FlexmarkHtmlConverter
Renders a tree of nodes to HTML.
Start with the builder()
method to configure the renderer. Example:
HtmlRenderer renderer = builder().escapeHtml(true).build();
renderer.render(node);
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Builder for configuring anFlexmarkHtmlConverter
.static interface
Extension forFlexmarkHtmlConverter
.private class
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
if true then will dump HTML tree of body element to console when usingconvert(String, Appendable)
(String)static final String
static final String
static String[]
static final DataKey<ExtensionConversion>
static final DataKey<ExtensionConversion>
static final DataKey<ExtensionConversion>
static final DataKey<LinkConversion>
static final DataKey<ExtensionConversion>
static final DataKey<LinkConversion>
static final DataKey<ExtensionConversion>
static final DataKey<ExtensionConversion>
static final DataKey<ExtensionConversion>
static final DataKey<ExtensionConversion>
static final DataKey<ExtensionConversion>
output control for FormattingAppendable, seeLineAppendable.setOptions(int)
static final String
static final String
static final String
static final String
static final String
static final String
static final String[]
static final String
(package private) final HtmlConverterOptions
static final String
If true then will ignore rows with th columns after rows with td columns have been emitted to the table.static final String
static final String
static final String
static final String
(package private) final List<HtmlLinkResolverFactory>
static final String
(package private) final List<DelegatingNodeRendererFactoryWrapper>
static final Iterable<org.jsoup.nodes.Node>
private static final Iterator<org.jsoup.nodes.Node>
static final String
private final DataHolder
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final DataKey<TableCaptionHandling>
Deprecated.static final DataKey<Map<Object,
CellAlignment>> private static final Map<Object,
CellAlignment> Deprecated.Deprecated.Deprecated.static final String
Deprecated.static final String
static final String
static final String
static final String
static final String
static final String
private static final String
private static final String
static final String
static final String
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static void
appendOuterHtml
(@NotNull HtmlNodeConverterSubContext context, @NotNull org.jsoup.nodes.Node node) builder()
Create a new builder for configuring anFlexmarkHtmlConverter
.builder
(DataHolder options) Create a new builder for configuring anFlexmarkHtmlConverter
.Parse HTML with default optionsParse HTML with given options and max trailing blank linesvoid
convert
(@NotNull String html, @NotNull Appendable output) Render a node to the appendableconvert
(org.jsoup.nodes.Node node) Render the tree of nodes to markdownvoid
convert
(org.jsoup.nodes.Node node, Appendable output, int maxTrailingBlankLines) Render a node to the appendablestatic void
dumpHtmlTree
(LineAppendable out, org.jsoup.nodes.Node node) (package private) static String
dumpState
(@NotNull HtmlNodeConverterContext context) (package private) static void
processConditional
(@NotNull HtmlNodeConverterContext context, @NotNull ExtensionConversion extensionConversion, @NotNull org.jsoup.nodes.Node node, @NotNull Runnable processNode) (package private) static void
processDefault
(@NotNull HtmlNodeConverterSubContext subContext, @NotNull org.jsoup.nodes.Node node, boolean outputUnknownTags) (package private) static void
processHtmlTree
(@NotNull HtmlNodeConverterSubContext context, @NotNull org.jsoup.nodes.Node parent, boolean outputAttributes, @Nullable Runnable prePopAction) (package private) static void
processTextNodes
(@NotNull HtmlNodeConverterContext context, @NotNull org.jsoup.nodes.Node node, boolean stripIdAttribute, @Nullable CharSequence textPrefix, @Nullable CharSequence textSuffix) static void
processWrapped
(@NotNull HtmlNodeConverterSubContext context, @NotNull org.jsoup.nodes.Node node, @Nullable Boolean isBlock, boolean escapeMarkdown) (package private) static void
wrapTextNodes
(@NotNull HtmlNodeConverterContext context, @NotNull org.jsoup.nodes.Node node, @NotNull CharSequence wrapText, boolean needSpaceAround)
-
Field Details
-
FORMAT_FLAGS
output control for FormattingAppendable, seeLineAppendable.setOptions(int)
-
MAX_BLANK_LINES
-
MAX_TRAILING_BLANK_LINES
-
LIST_CONTENT_INDENT
-
SETEXT_HEADINGS
-
OUTPUT_UNKNOWN_TAGS
-
TYPOGRAPHIC_QUOTES
-
TYPOGRAPHIC_SMARTS
-
EXTRACT_AUTO_LINKS
-
OUTPUT_ATTRIBUTES_ID
-
OUTPUT_ATTRIBUTES_NAMES_REGEX
-
WRAP_AUTO_LINKS
-
RENDER_COMMENTS
-
DOT_ONLY_NUMERIC_LISTS
-
COMMENT_ORIGINAL_NON_NUMERIC_LIST_ITEM
-
PRE_CODE_PRESERVE_EMPHASIS
-
ORDERED_LIST_DELIMITER
-
UNORDERED_LIST_DELIMITER
-
DEFINITION_MARKER_SPACES
-
MIN_SETEXT_HEADING_MARKER_LENGTH
-
LIST_ITEM_INDENT
-
CODE_INDENT
-
NBSP_TEXT
-
EOL_IN_TITLE_ATTRIBUTE
-
THEMATIC_BREAK
-
UNWRAPPED_TAGS
-
WRAPPED_TAGS
-
OUTPUT_ID_ATTRIBUTE_REGEX
-
TABLE_MIN_SEPARATOR_COLUMN_WIDTH
Deprecated. -
TABLE_MIN_SEPARATOR_DASHES
Deprecated. -
TABLE_LEAD_TRAIL_PIPES
Deprecated. -
TABLE_SPACE_AROUND_PIPES
Deprecated. -
TABLE_CAPTION
Deprecated. -
LISTS_END_ON_DOUBLE_BLANK
-
DIV_AS_PARAGRAPH
-
BR_AS_PARA_BREAKS
-
BR_AS_EXTRA_BLANK_LINES
-
DIV_TABLE_PROCESSING
-
DIV_TABLE_HDR_CLASSES
-
DIV_TABLE_ROW_CLASSES
-
DIV_TABLE_CELL_CLASSES
-
ADD_TRAILING_EOL
-
SKIP_HEADING_1
-
SKIP_HEADING_2
-
SKIP_HEADING_3
-
SKIP_HEADING_4
-
SKIP_HEADING_5
-
SKIP_HEADING_6
-
SKIP_ATTRIBUTES
-
SKIP_FENCED_CODE
-
SKIP_CHAR_ESCAPE
-
EXT_INLINE_STRONG
-
EXT_INLINE_EMPHASIS
-
EXT_INLINE_CODE
-
EXT_INLINE_DEL
-
EXT_INLINE_INS
-
EXT_INLINE_SUB
-
EXT_INLINE_SUP
-
EXT_MATH
-
EXT_TABLES
-
EXT_INLINE_LINK
-
EXT_INLINE_IMAGE
-
FOR_DOCUMENT
-
TYPOGRAPHIC_REPLACEMENT_MAP
-
DUMP_HTML_TREE
if true then will dump HTML tree of body element to console when usingconvert(String, Appendable)
(String) -
IGNORE_TABLE_HEADING_AFTER_ROWS
If true then will ignore rows with th columns after rows with td columns have been emitted to the table.If false then will convert these to regular columns.
-
A_NODE
- See Also:
-
ABBR_NODE
- See Also:
-
ASIDE_NODE
- See Also:
-
BR_NODE
- See Also:
-
BLOCKQUOTE_NODE
- See Also:
-
CODE_NODE
- See Also:
-
IMG_NODE
- See Also:
-
DEL_NODE
- See Also:
-
STRIKE_NODE
- See Also:
-
DIV_NODE
- See Also:
-
DD_NODE
- See Also:
-
DL_NODE
- See Also:
-
DT_NODE
- See Also:
-
I_NODE
- See Also:
-
EM_NODE
- See Also:
-
B_NODE
- See Also:
-
STRONG_NODE
- See Also:
-
EMOJI_NODE
- See Also:
-
INPUT_NODE
- See Also:
-
INS_NODE
- See Also:
-
U_NODE
- See Also:
-
SUB_NODE
- See Also:
-
SUP_NODE
- See Also:
-
HR_NODE
- See Also:
-
OL_NODE
- See Also:
-
UL_NODE
- See Also:
-
LI_NODE
- See Also:
-
TABLE_NODE
- See Also:
-
TBODY_NODE
- See Also:
-
TD_NODE
- See Also:
-
TH_NODE
- See Also:
-
THEAD_NODE
- See Also:
-
TR_NODE
- See Also:
-
CAPTION_NODE
- See Also:
-
SVG_NODE
- See Also:
-
P_NODE
- See Also:
-
PRE_NODE
- See Also:
-
MATH_NODE
- See Also:
-
SPAN_NODE
- See Also:
-
TEXT_NODE
- See Also:
-
COMMENT_NODE
- See Also:
-
H1_NODE
- See Also:
-
H2_NODE
- See Also:
-
H3_NODE
- See Also:
-
H4_NODE
- See Also:
-
H5_NODE
- See Also:
-
H6_NODE
- See Also:
-
DEFAULT_NODE
- See Also:
-
HEADING_NODES
-
EXPLICIT_LINK_TEXT_TAGS
-
TABLE_CELL_ALIGNMENTS
-
SPECIAL_CHARS_MAP
-
TYPOGRAPHIC_QUOTES_PIPED
- See Also:
-
TYPOGRAPHIC_SMARTS_PIPED
- See Also:
-
TABLE_CELL_ALIGNMENT_MAP
-
htmlConverterOptions
-
options
-
nodeRendererFactories
-
linkResolverFactories
-
NULL_ITERATOR
-
NULL_ITERABLE
-
-
Constructor Details
-
FlexmarkHtmlConverter
FlexmarkHtmlConverter(FlexmarkHtmlConverter.Builder builder)
-
-
Method Details
-
getOptions
-
builder
Create a new builder for configuring anFlexmarkHtmlConverter
.- Returns:
- a builder
-
builder
Create a new builder for configuring anFlexmarkHtmlConverter
.- Parameters:
options
- initialization options- Returns:
- a builder
-
convert
Render a node to the appendable- Parameters:
html
- html to convert to markdownoutput
- appendable to use for the output
-
convert
Parse HTML with default options- Parameters:
html
- html to be parsed- Returns:
- resulting markdown string
-
convert
Parse HTML with given options and max trailing blank lines- Parameters:
html
- html to be parsedmaxTrailingBlankLines
- max trailing blank lines, -1 will suppress trailing EOL- Returns:
- resulting markdown string
-
dumpHtmlTree
-
convert
Render a node to the appendable- Parameters:
node
- node to renderoutput
- appendable to use for the outputmaxTrailingBlankLines
- max blank lines allowed at end of output
-
convert
Render the tree of nodes to markdown- Parameters:
node
- the root node- Returns:
- the formatted markdown
-
processTextNodes
static void processTextNodes(@NotNull @NotNull HtmlNodeConverterContext context, @NotNull @NotNull org.jsoup.nodes.Node node, boolean stripIdAttribute, @Nullable @Nullable CharSequence textPrefix, @Nullable @Nullable CharSequence textSuffix) -
wrapTextNodes
static void wrapTextNodes(@NotNull @NotNull HtmlNodeConverterContext context, @NotNull @NotNull org.jsoup.nodes.Node node, @NotNull @NotNull CharSequence wrapText, boolean needSpaceAround) -
processConditional
static void processConditional(@NotNull @NotNull HtmlNodeConverterContext context, @NotNull @NotNull ExtensionConversion extensionConversion, @NotNull @NotNull org.jsoup.nodes.Node node, @NotNull @NotNull Runnable processNode) -
appendOuterHtml
static void appendOuterHtml(@NotNull @NotNull HtmlNodeConverterSubContext context, @NotNull @NotNull org.jsoup.nodes.Node node) -
processWrapped
public static void processWrapped(@NotNull @NotNull HtmlNodeConverterSubContext context, @NotNull @NotNull org.jsoup.nodes.Node node, @Nullable @Nullable Boolean isBlock, boolean escapeMarkdown) -
processHtmlTree
static void processHtmlTree(@NotNull @NotNull HtmlNodeConverterSubContext context, @NotNull @NotNull org.jsoup.nodes.Node parent, boolean outputAttributes, @Nullable @Nullable Runnable prePopAction) -
dumpState
-
processDefault
static void processDefault(@NotNull @NotNull HtmlNodeConverterSubContext subContext, @NotNull @NotNull org.jsoup.nodes.Node node, boolean outputUnknownTags)
-