Package com.vladsch.flexmark.html
Class HtmlRenderer
- java.lang.Object
-
- com.vladsch.flexmark.html.HtmlRenderer
-
- All Implemented Interfaces:
IRender
public class HtmlRenderer extends java.lang.Object implements 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 Classes Modifier and Type Class Description static class
HtmlRenderer.Builder
Builder for configuring anHtmlRenderer
.static interface
HtmlRenderer.HtmlRendererExtension
Extension forHtmlRenderer
.private class
HtmlRenderer.MainNodeRenderer
-
Field Summary
-
Constructor Summary
Constructors Constructor Description HtmlRenderer(@NotNull HtmlRenderer.Builder builder)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static @NotNull MutableDataHolder
addRenderTypeEquivalence(@NotNull MutableDataHolder options, @NotNull java.lang.String rendererType, @NotNull java.lang.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
getOptions()
Get Options for parsingstatic boolean
isCompatibleRendererType(@NotNull MutableDataHolder options, @NotNull java.lang.String supportedRendererType)
static boolean
isCompatibleRendererType(@NotNull MutableDataHolder options, @NotNull java.lang.String rendererType, @NotNull java.lang.String supportedRendererType)
@NotNull java.lang.String
render(@NotNull Node node)
Render the tree of nodes to HTML.void
render(@NotNull Node node, @NotNull java.lang.Appendable output)
Render a node to the appendablevoid
render(@NotNull Node node, @NotNull java.lang.Appendable output, int maxTrailingBlankLines)
Render a node to the appendable
-
-
-
Field Detail
-
SOFT_BREAK
public static final DataKey<java.lang.String> SOFT_BREAK
-
HARD_BREAK
public static final DataKey<java.lang.String> HARD_BREAK
-
STRONG_EMPHASIS_STYLE_HTML_OPEN
public static final NullableDataKey<java.lang.String> STRONG_EMPHASIS_STYLE_HTML_OPEN
-
STRONG_EMPHASIS_STYLE_HTML_CLOSE
public static final NullableDataKey<java.lang.String> STRONG_EMPHASIS_STYLE_HTML_CLOSE
-
EMPHASIS_STYLE_HTML_OPEN
public static final NullableDataKey<java.lang.String> EMPHASIS_STYLE_HTML_OPEN
-
EMPHASIS_STYLE_HTML_CLOSE
public static final NullableDataKey<java.lang.String> EMPHASIS_STYLE_HTML_CLOSE
-
CODE_STYLE_HTML_OPEN
public static final NullableDataKey<java.lang.String> CODE_STYLE_HTML_OPEN
-
CODE_STYLE_HTML_CLOSE
public static final NullableDataKey<java.lang.String> CODE_STYLE_HTML_CLOSE
-
INLINE_CODE_SPLICE_CLASS
public static final NullableDataKey<java.lang.String> INLINE_CODE_SPLICE_CLASS
-
PERCENT_ENCODE_URLS
public static final DataKey<java.lang.Boolean> PERCENT_ENCODE_URLS
-
INDENT_SIZE
public static final DataKey<java.lang.Integer> INDENT_SIZE
-
ESCAPE_HTML
public static final DataKey<java.lang.Boolean> ESCAPE_HTML
-
ESCAPE_HTML_BLOCKS
public static final DataKey<java.lang.Boolean> ESCAPE_HTML_BLOCKS
-
ESCAPE_HTML_COMMENT_BLOCKS
public static final DataKey<java.lang.Boolean> ESCAPE_HTML_COMMENT_BLOCKS
-
ESCAPE_INLINE_HTML
public static final DataKey<java.lang.Boolean> ESCAPE_INLINE_HTML
-
ESCAPE_INLINE_HTML_COMMENTS
public static final DataKey<java.lang.Boolean> ESCAPE_INLINE_HTML_COMMENTS
-
SUPPRESS_HTML
public static final DataKey<java.lang.Boolean> SUPPRESS_HTML
-
SUPPRESS_HTML_BLOCKS
public static final DataKey<java.lang.Boolean> SUPPRESS_HTML_BLOCKS
-
SUPPRESS_HTML_COMMENT_BLOCKS
public static final DataKey<java.lang.Boolean> SUPPRESS_HTML_COMMENT_BLOCKS
-
SUPPRESS_INLINE_HTML
public static final DataKey<java.lang.Boolean> SUPPRESS_INLINE_HTML
-
SUPPRESS_INLINE_HTML_COMMENTS
public static final DataKey<java.lang.Boolean> SUPPRESS_INLINE_HTML_COMMENTS
-
SOURCE_WRAP_HTML
public static final DataKey<java.lang.Boolean> SOURCE_WRAP_HTML
-
SOURCE_WRAP_HTML_BLOCKS
public static final DataKey<java.lang.Boolean> SOURCE_WRAP_HTML_BLOCKS
-
HEADER_ID_GENERATOR_RESOLVE_DUPES
public static final DataKey<java.lang.Boolean> HEADER_ID_GENERATOR_RESOLVE_DUPES
-
HEADER_ID_GENERATOR_TO_DASH_CHARS
public static final DataKey<java.lang.String> HEADER_ID_GENERATOR_TO_DASH_CHARS
-
HEADER_ID_GENERATOR_NON_DASH_CHARS
public static final DataKey<java.lang.String> HEADER_ID_GENERATOR_NON_DASH_CHARS
-
HEADER_ID_GENERATOR_NO_DUPED_DASHES
public static final DataKey<java.lang.Boolean> HEADER_ID_GENERATOR_NO_DUPED_DASHES
-
HEADER_ID_GENERATOR_NON_ASCII_TO_LOWERCASE
public static final DataKey<java.lang.Boolean> HEADER_ID_GENERATOR_NON_ASCII_TO_LOWERCASE
-
HEADER_ID_REF_TEXT_TRIM_LEADING_SPACES
public static final DataKey<java.lang.Boolean> HEADER_ID_REF_TEXT_TRIM_LEADING_SPACES
-
HEADER_ID_REF_TEXT_TRIM_TRAILING_SPACES
public static final DataKey<java.lang.Boolean> HEADER_ID_REF_TEXT_TRIM_TRAILING_SPACES
-
HEADER_ID_ADD_EMOJI_SHORTCUT
public static final DataKey<java.lang.Boolean> HEADER_ID_ADD_EMOJI_SHORTCUT
-
RENDER_HEADER_ID
public static final DataKey<java.lang.Boolean> RENDER_HEADER_ID
-
GENERATE_HEADER_ID
public static final DataKey<java.lang.Boolean> GENERATE_HEADER_ID
-
DO_NOT_RENDER_LINKS
public static final DataKey<java.lang.Boolean> DO_NOT_RENDER_LINKS
-
FENCED_CODE_LANGUAGE_CLASS_PREFIX
public static final DataKey<java.lang.String> FENCED_CODE_LANGUAGE_CLASS_PREFIX
-
FENCED_CODE_LANGUAGE_CLASS_MAP
public static final DataKey<java.util.HashMap<java.lang.String,java.lang.String>> FENCED_CODE_LANGUAGE_CLASS_MAP
-
FENCED_CODE_NO_LANGUAGE_CLASS
public static final DataKey<java.lang.String> FENCED_CODE_NO_LANGUAGE_CLASS
-
FENCED_CODE_LANGUAGE_DELIMITERS
public static final DataKey<java.lang.String> FENCED_CODE_LANGUAGE_DELIMITERS
-
SOURCE_POSITION_ATTRIBUTE
public static final DataKey<java.lang.String> SOURCE_POSITION_ATTRIBUTE
-
SOURCE_POSITION_PARAGRAPH_LINES
public static final DataKey<java.lang.Boolean> SOURCE_POSITION_PARAGRAPH_LINES
-
TYPE
public static final DataKey<java.lang.String> TYPE
-
RECHECK_UNDEFINED_REFERENCES
public static final DataKey<java.lang.Boolean> RECHECK_UNDEFINED_REFERENCES
-
OBFUSCATE_EMAIL
public static final DataKey<java.lang.Boolean> OBFUSCATE_EMAIL
-
OBFUSCATE_EMAIL_RANDOM
public static final DataKey<java.lang.Boolean> OBFUSCATE_EMAIL_RANDOM
-
HTML_BLOCK_OPEN_TAG_EOL
public static final DataKey<java.lang.Boolean> HTML_BLOCK_OPEN_TAG_EOL
-
HTML_BLOCK_CLOSE_TAG_EOL
public static final DataKey<java.lang.Boolean> HTML_BLOCK_CLOSE_TAG_EOL
-
UNESCAPE_HTML_ENTITIES
public static final DataKey<java.lang.Boolean> UNESCAPE_HTML_ENTITIES
-
AUTOLINK_WWW_PREFIX
public static final DataKey<java.lang.String> AUTOLINK_WWW_PREFIX
-
SUPPRESSED_LINKS
public static final DataKey<java.lang.String> SUPPRESSED_LINKS
-
NO_P_TAGS_USE_BR
public static final DataKey<java.lang.Boolean> NO_P_TAGS_USE_BR
-
EMBEDDED_ATTRIBUTE_PROVIDER
public static final DataKey<java.lang.Boolean> EMBEDDED_ATTRIBUTE_PROVIDER
-
FORMAT_FLAGS
public static final DataKey<java.lang.Integer> FORMAT_FLAGS
output control for FormattingAppendable, seeLineAppendable.setOptions(int)
-
MAX_TRAILING_BLANK_LINES
public static final DataKey<java.lang.Integer> MAX_TRAILING_BLANK_LINES
-
MAX_BLANK_LINES
public static final DataKey<java.lang.Integer> MAX_BLANK_LINES
-
CONVERT_TABS
@Deprecated public static final int CONVERT_TABS
Deprecated.
-
COLLAPSE_WHITESPACE
@Deprecated public static final int COLLAPSE_WHITESPACE
Deprecated.
-
SUPPRESS_TRAILING_WHITESPACE
@Deprecated public static final int SUPPRESS_TRAILING_WHITESPACE
Deprecated.
-
PASS_THROUGH
@Deprecated public static final int PASS_THROUGH
Deprecated.
-
FORMAT_ALL
@Deprecated public static final int FORMAT_ALL
Deprecated.
-
RENDERER_TYPE_EQUIVALENCE
public static final DataKey<java.util.List<Pair<java.lang.String,java.lang.String>>> 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 public static final int FORMAT_CONVERT_TABS
Deprecated.
-
FORMAT_COLLAPSE_WHITESPACE
@Deprecated public static final int FORMAT_COLLAPSE_WHITESPACE
Deprecated.
-
FORMAT_SUPPRESS_TRAILING_WHITESPACE
@Deprecated public static final int FORMAT_SUPPRESS_TRAILING_WHITESPACE
Deprecated.
-
FORMAT_ALL_OPTIONS
@Deprecated public static final int FORMAT_ALL_OPTIONS
Deprecated.
-
TRACKED_OFFSETS
public static final DataKey<java.util.List<TrackedOffset>> TRACKED_OFFSETS
-
attributeProviderFactories
final java.util.List<AttributeProviderFactory> attributeProviderFactories
-
nodeRendererFactories
final java.util.List<DelegatingNodeRendererFactoryWrapper> nodeRendererFactories
-
linkResolverFactories
final java.util.List<LinkResolverFactory> linkResolverFactories
-
htmlIdGeneratorFactory
final HeaderIdGeneratorFactory htmlIdGeneratorFactory
-
htmlOptions
final HtmlRendererOptions htmlOptions
-
options
final DataHolder options
-
-
Constructor Detail
-
HtmlRenderer
HtmlRenderer(@NotNull @NotNull HtmlRenderer.Builder builder)
-
-
Method Detail
-
builder
@NotNull public static @NotNull HtmlRenderer.Builder 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
@NotNull public @NotNull DataHolder getOptions()
Description copied from interface:IRender
Get Options for parsing- Specified by:
getOptions
in interfaceIRender
- Returns:
- DataHolder for options
-
render
public void render(@NotNull @NotNull Node node, @NotNull @NotNull java.lang.Appendable output)
Render a node to the appendable
-
render
public void render(@NotNull @NotNull Node node, @NotNull @NotNull java.lang.Appendable output, int maxTrailingBlankLines)
Render a node to the appendable- Parameters:
node
- node to renderoutput
- appendable to use for the output
-
render
@NotNull public @NotNull java.lang.String render(@NotNull @NotNull Node node)
Render the tree of nodes to HTML.
-
isCompatibleRendererType
public static boolean isCompatibleRendererType(@NotNull @NotNull MutableDataHolder options, @NotNull @NotNull java.lang.String supportedRendererType)
-
isCompatibleRendererType
public static boolean isCompatibleRendererType(@NotNull @NotNull MutableDataHolder options, @NotNull @NotNull java.lang.String rendererType, @NotNull @NotNull java.lang.String supportedRendererType)
-
addRenderTypeEquivalence
@NotNull public static @NotNull MutableDataHolder addRenderTypeEquivalence(@NotNull @NotNull MutableDataHolder options, @NotNull @NotNull java.lang.String rendererType, @NotNull @NotNull java.lang.String supportedRendererType)
-
-