Package com.vladsch.flexmark.html
Class HtmlRenderer
java.lang.Object
com.vladsch.flexmark.html.HtmlRenderer
- All Implemented Interfaces:
IRender
Renders a tree of nodes to HTML.
Start with the builder()
method to configure the renderer. Example:
HtmlRenderer renderer = HtmlRenderer.builder().escapeHtml(true).build();
renderer.render(node);
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Builder for configuring anHtmlRenderer
.static interface
Extension forHtmlRenderer
.private class
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) final List<AttributeProviderFactory>
static final NullableDataKey<String>
static final NullableDataKey<String>
static final int
Deprecated.static final int
Deprecated.static final NullableDataKey<String>
static final NullableDataKey<String>
static final int
Deprecated.static final int
Deprecated.static final int
Deprecated.static final int
Deprecated.output control for FormattingAppendable, seeLineAppendable.setOptions(int)
static final int
Deprecated.(package private) final HeaderIdGeneratorFactory
(package private) final HtmlRendererOptions
static final NullableDataKey<String>
(package private) final List<LinkResolverFactory>
(package private) final List<DelegatingNodeRendererFactoryWrapper>
(package private) final DataHolder
static final int
Deprecated.Stores pairs of equivalent renderer types to allow extensions to resolve types not known to themstatic final NullableDataKey<String>
static final NullableDataKey<String>
static final int
Deprecated.static final DataKey<List<TrackedOffset>>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull MutableDataHolder
addRenderTypeEquivalence
(@NotNull MutableDataHolder options, @NotNull String rendererType, @NotNull String supportedRendererType) static @NotNull HtmlRenderer.Builder
builder()
Create a new builder for configuring anHtmlRenderer
.static @NotNull HtmlRenderer.Builder
builder
(@Nullable DataHolder options) Create a new builder for configuring anHtmlRenderer
.@NotNull DataHolder
Get Options for parsingstatic boolean
isCompatibleRendererType
(@NotNull MutableDataHolder options, @NotNull String supportedRendererType) static boolean
isCompatibleRendererType
(@NotNull MutableDataHolder options, @NotNull String rendererType, @NotNull String supportedRendererType) @NotNull String
Render the tree of nodes to HTML.void
render
(@NotNull Node node, @NotNull Appendable output) Render a node to the appendablevoid
render
(@NotNull Node node, @NotNull Appendable output, int maxTrailingBlankLines) Render a node to the appendable
-
Field Details
-
SOFT_BREAK
-
HARD_BREAK
-
STRONG_EMPHASIS_STYLE_HTML_OPEN
-
STRONG_EMPHASIS_STYLE_HTML_CLOSE
-
EMPHASIS_STYLE_HTML_OPEN
-
EMPHASIS_STYLE_HTML_CLOSE
-
CODE_STYLE_HTML_OPEN
-
CODE_STYLE_HTML_CLOSE
-
INLINE_CODE_SPLICE_CLASS
-
PERCENT_ENCODE_URLS
-
INDENT_SIZE
-
ESCAPE_HTML
-
ESCAPE_HTML_BLOCKS
-
ESCAPE_HTML_COMMENT_BLOCKS
-
ESCAPE_INLINE_HTML
-
ESCAPE_INLINE_HTML_COMMENTS
-
SUPPRESS_HTML
-
SUPPRESS_HTML_BLOCKS
-
SUPPRESS_HTML_COMMENT_BLOCKS
-
SUPPRESS_INLINE_HTML
-
SUPPRESS_INLINE_HTML_COMMENTS
-
SOURCE_WRAP_HTML
-
SOURCE_WRAP_HTML_BLOCKS
-
HEADER_ID_GENERATOR_RESOLVE_DUPES
-
HEADER_ID_GENERATOR_TO_DASH_CHARS
-
HEADER_ID_GENERATOR_NON_DASH_CHARS
-
HEADER_ID_GENERATOR_NO_DUPED_DASHES
-
HEADER_ID_GENERATOR_NON_ASCII_TO_LOWERCASE
-
HEADER_ID_REF_TEXT_TRIM_LEADING_SPACES
-
HEADER_ID_REF_TEXT_TRIM_TRAILING_SPACES
-
HEADER_ID_ADD_EMOJI_SHORTCUT
-
RENDER_HEADER_ID
-
GENERATE_HEADER_ID
-
DO_NOT_RENDER_LINKS
-
FENCED_CODE_LANGUAGE_CLASS_PREFIX
-
FENCED_CODE_LANGUAGE_CLASS_MAP
-
FENCED_CODE_NO_LANGUAGE_CLASS
-
FENCED_CODE_LANGUAGE_DELIMITERS
-
SOURCE_POSITION_ATTRIBUTE
-
SOURCE_POSITION_PARAGRAPH_LINES
-
TYPE
-
TAG_RANGES
-
RECHECK_UNDEFINED_REFERENCES
-
OBFUSCATE_EMAIL
-
OBFUSCATE_EMAIL_RANDOM
-
HTML_BLOCK_OPEN_TAG_EOL
-
HTML_BLOCK_CLOSE_TAG_EOL
-
UNESCAPE_HTML_ENTITIES
-
AUTOLINK_WWW_PREFIX
-
SUPPRESSED_LINKS
-
NO_P_TAGS_USE_BR
-
EMBEDDED_ATTRIBUTE_PROVIDER
-
FORMAT_FLAGS
output control for FormattingAppendable, seeLineAppendable.setOptions(int)
-
MAX_TRAILING_BLANK_LINES
-
MAX_BLANK_LINES
-
CONVERT_TABS
Deprecated. -
COLLAPSE_WHITESPACE
Deprecated. -
SUPPRESS_TRAILING_WHITESPACE
Deprecated. -
PASS_THROUGH
Deprecated. -
FORMAT_ALL
Deprecated. -
RENDERER_TYPE_EQUIVALENCE
Stores pairs of equivalent renderer types to allow extensions to resolve types not known to themPair contains: rendererType, equivalentType
-
FORMAT_CONVERT_TABS
Deprecated. -
FORMAT_COLLAPSE_WHITESPACE
Deprecated. -
FORMAT_SUPPRESS_TRAILING_WHITESPACE
Deprecated. -
FORMAT_ALL_OPTIONS
Deprecated. -
TRACKED_OFFSETS
-
attributeProviderFactories
-
nodeRendererFactories
-
linkResolverFactories
-
htmlIdGeneratorFactory
-
htmlOptions
-
options
-
-
Constructor Details
-
HtmlRenderer
HtmlRenderer(@NotNull @NotNull HtmlRenderer.Builder builder)
-
-
Method Details
-
builder
Create a new builder for configuring anHtmlRenderer
.- Returns:
- a builder
-
builder
@NotNull public static @NotNull HtmlRenderer.Builder builder(@Nullable @Nullable DataHolder options) Create a new builder for configuring anHtmlRenderer
.- Parameters:
options
- initialization options- Returns:
- a builder
-
getOptions
Description copied from interface:IRender
Get Options for parsing- Specified by:
getOptions
in interfaceIRender
- Returns:
- DataHolder for options
-
render
Render a node to the appendable -
render
public void render(@NotNull @NotNull Node node, @NotNull @NotNull Appendable output, int maxTrailingBlankLines) Render a node to the appendable- Parameters:
node
- node to renderoutput
- appendable to use for the output
-
render
Render the tree of nodes to HTML. -
isCompatibleRendererType
public static boolean isCompatibleRendererType(@NotNull @NotNull MutableDataHolder options, @NotNull @NotNull String supportedRendererType) -
isCompatibleRendererType
public static boolean isCompatibleRendererType(@NotNull @NotNull MutableDataHolder options, @NotNull @NotNull String rendererType, @NotNull @NotNull String supportedRendererType) -
addRenderTypeEquivalence
@NotNull public static @NotNull MutableDataHolder addRenderTypeEquivalence(@NotNull @NotNull MutableDataHolder options, @NotNull @NotNull String rendererType, @NotNull @NotNull String supportedRendererType)
-