Package org.commonmark.renderer.text
Class TextContentRenderer.Builder
java.lang.Object
org.commonmark.renderer.text.TextContentRenderer.Builder
- Enclosing class:
TextContentRenderer
Builder for configuring a
TextContentRenderer
. See methods for default configuration.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()
extensions
(Iterable<? extends Extension> extensions) nodeRendererFactory
(TextContentNodeRendererFactory nodeRendererFactory) Add a factory for instantiating a node renderer (done when rendering).stripNewlines
(boolean stripNewlines) Set the value of flag for stripping new lines.
-
Field Details
-
stripNewlines
private boolean stripNewlines -
nodeRendererFactories
-
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
build
- Returns:
- the configured
TextContentRenderer
-
stripNewlines
Set the value of flag for stripping new lines.- Parameters:
stripNewlines
- true for stripping new lines and render text as "single line", false for keeping all line breaks- Returns:
this
-
nodeRendererFactory
public TextContentRenderer.Builder nodeRendererFactory(TextContentNodeRendererFactory nodeRendererFactory) Add a factory for instantiating a node renderer (done when rendering). This allows to override the rendering of node types or define rendering for custom node types.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.)
- Parameters:
nodeRendererFactory
- the factory for creating a node renderer- Returns:
this
-
extensions
- Parameters:
extensions
- extensions to use on this text content renderer- Returns:
this
-