public static class HtmlRenderer.Builder extends com.vladsch.flexmark.util.options.MutableDataSet implements RendererBuilder
HtmlRenderer. See methods for default configuration.| Constructor and Description |
|---|
Builder() |
Builder(com.vladsch.flexmark.util.options.DataHolder options) |
Builder(HtmlRenderer.Builder other) |
Builder(HtmlRenderer.Builder other,
com.vladsch.flexmark.util.options.DataHolder options) |
| Modifier and Type | Method and Description |
|---|---|
HtmlRenderer.Builder |
attributeProviderFactory(AttributeProviderFactory attributeProviderFactory)
Add an attribute provider for adding/changing HTML attributes to the rendered tags.
|
HtmlRenderer |
build() |
HtmlRenderer.Builder |
escapeHtml(boolean escapeHtml)
|
HtmlRenderer.Builder |
extensions(Iterable<? extends Extension> extensions) |
HtmlRenderer.Builder |
htmlIdGeneratorFactory(HeaderIdGeneratorFactory htmlIdGeneratorFactory)
Add a factory for generating the header id attribute from the header's text
|
HtmlRenderer.Builder |
indentSize(int indentSize)
The size of the indent to use for hierarchical elements, default 0, means no indent, also fastest rendering
|
boolean |
isRendererType(String supportedRendererType) |
HtmlRenderer.Builder |
linkResolverFactory(LinkResolverFactory linkResolverFactory)
Add a factory for instantiating a node renderer (done when rendering).
|
HtmlRenderer.Builder |
nodeRendererFactory(NodeRendererFactory nodeRendererFactory)
Add a factory for instantiating a node renderer (done when rendering).
|
HtmlRenderer.Builder |
percentEncodeUrls(boolean percentEncodeUrls)
Whether URLs of link or images should be percent-encoded, defaults to
false. |
HtmlRenderer.Builder |
softBreak(String softBreak)
The HTML to use for rendering a softbreak, defaults to
"\n" (meaning the rendered result doesn't have
a line break). |
clear, get, getOrCompute, merge, remove, set, setAll, setFrom, setIn, toImmutable, toMutablepublic Builder()
public Builder(com.vladsch.flexmark.util.options.DataHolder options)
public Builder(HtmlRenderer.Builder other)
public Builder(HtmlRenderer.Builder other, com.vladsch.flexmark.util.options.DataHolder options)
public HtmlRenderer build()
HtmlRendererpublic HtmlRenderer.Builder softBreak(String softBreak)
"\n" (meaning the rendered result doesn't have
a line break).
Set it to "<br>" (or "<br />" to make them hard breaks.
Set it to " " to ignore line wrapping in the source.
softBreak - HTML for softbreakthispublic HtmlRenderer.Builder indentSize(int indentSize)
indentSize - number of spaces per indentthispublic HtmlRenderer.Builder escapeHtml(boolean escapeHtml)
HtmlInline and HtmlBlock should be escaped, defaults to false.
Note that HtmlInline is only a tag itself, not the text between an opening tag and a closing tag. So
markup in the text will be parsed as normal and is not affected by this option.
escapeHtml - true for escaping, false for preserving raw HTMLthispublic boolean isRendererType(String supportedRendererType)
public HtmlRenderer.Builder percentEncodeUrls(boolean percentEncodeUrls)
false.
If enabled, the following is done:
percentEncodeUrls - true to percent-encode, false for leaving as-isthispublic HtmlRenderer.Builder attributeProviderFactory(AttributeProviderFactory attributeProviderFactory)
attributeProviderFactory in interface RendererBuilderattributeProviderFactory - the attribute provider factory to addthispublic HtmlRenderer.Builder nodeRendererFactory(NodeRendererFactory nodeRendererFactory)
If multiple node renderers for the same node type are created, the one from the factory that was added first "wins". (This is how the rendering for core node types can be overridden; the default rendering comes last.)
nodeRendererFactory - the factory for creating a node rendererthispublic HtmlRenderer.Builder linkResolverFactory(LinkResolverFactory linkResolverFactory)
If multiple node renderers for the same node type are created, the one from the factory that was added first "wins". (This is how the rendering for core node types can be overridden; the default rendering comes last.)
linkResolverFactory in interface RendererBuilderlinkResolverFactory - the factory for creating a node rendererthispublic HtmlRenderer.Builder htmlIdGeneratorFactory(HeaderIdGeneratorFactory htmlIdGeneratorFactory)
htmlIdGeneratorFactory in interface RendererBuilderhtmlIdGeneratorFactory - the factory for generating header tag id attributesthispublic HtmlRenderer.Builder extensions(Iterable<? extends Extension> extensions)
extensions - extensions to use on this HTML rendererthisCopyright © 2018. All rights reserved.