public class BlockRendererComponent extends Object implements RendererComponent
BlockRenderers on the lines of wiki markup, and ensuring anything not dealt with by
a BlockRenderer is grouped into paragraphs appropriately.
The component has a configurable list of BlockRenderers. The wiki markup is split up and fed to the
BlockRenderers line by line. They are passed the current LineWalker so that they can temporarily wrest
control from the BlockRendererComponent and process however many consecutive lines they want. Once a BlockRenderer
renders a line, that line will not be passed into any other BlockRenderers. Rather, the previous paragraph will be
finished, and the rendered block will be added after it.
Content that does not get rendered by a BlockRenderer has further processing applied. Consecutive chunks of
content that contain no block tokens and are not handled by a BlockRenderer are grouped together into a paragraph.
They then have p tags wrapped around them. If a line containing block tokens is not handled by any BlockRenderer,
then it will be split up around the block tokens. The block tokens will not form part of a paragraph but paragraphs
will be made of text between block tokens. Text before the first token will be appended to the previous paragraph.
Text after the last token will be used as the start of the next paragraph.
| Constructor and Description |
|---|
BlockRendererComponent(SubRenderer subRenderer,
List<BlockRenderer> blockRenderers) |
| Modifier and Type | Method and Description |
|---|---|
String |
render(String wiki,
RenderContext context)
Render this piece of wiki text.
|
void |
setBlockRenderers(List<BlockRenderer> blockRenderers) |
boolean |
shouldRender(RenderMode renderMode)
Whether or not this render component is required given the current render mode.
|
public BlockRendererComponent(SubRenderer subRenderer, List<BlockRenderer> blockRenderers)
public void setBlockRenderers(List<BlockRenderer> blockRenderers)
public boolean shouldRender(RenderMode renderMode)
RendererComponentshouldRender in interface RendererComponentpublic String render(String wiki, RenderContext context)
RendererComponentrender in interface RendererComponentCopyright © 2019 Atlassian. All rights reserved.