java.lang.Object
org.commonmark.renderer.text.TextContentWriter
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Stringprivate final Appendableprivate charprivate final LineBreakRenderingprivate final LinkedList<String>private final LinkedList<Boolean> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidappend(char c) private voidvoidblock()voidcolon()private voidIf a block separator has been enqueued withblock()but not yet written, write it now.private booleanisTight()voidline()voidRemove the last prefix from the top of the stack.voidpopTight()Remove the last "tight" setting from the top of the stack.voidpushPrefix(String prefix) Push a prefix onto the top of the stack.voidpushTight(boolean tight) Change whether blocks are tight or loose.voidvoidvoidwrite(char c) voidvoidwritePrefix(String prefix) Write a prefix.private voidvoid
-
Field Details
-
buffer
-
lineBreakRendering
-
prefixes
-
tight
-
blockSeparator
-
lastChar
private char lastChar
-
-
Constructor Details
-
TextContentWriter
-
TextContentWriter
-
-
Method Details
-
whitespace
public void whitespace() -
colon
public void colon() -
line
public void line() -
block
public void block() -
resetBlock
public void resetBlock() -
writeStripped
-
write
-
write
public void write(char c) -
pushPrefix
Push a prefix onto the top of the stack. All prefixes are written at the beginning of each line, until the prefix is popped again.- Parameters:
prefix- the raw prefix string
-
writePrefix
Write a prefix.- Parameters:
prefix- the raw prefix string to write
-
popPrefix
public void popPrefix()Remove the last prefix from the top of the stack. -
pushTight
public void pushTight(boolean tight) Change whether blocks are tight or loose. Loose is the default where blocks are separated by a blank line. Tight is where blocks are not separated by a blank line. Tight blocks are used in lists, if there are no blank lines within the list.Note that changing this does not affect block separators that have already been enqueued with
block(), only future ones. -
popTight
public void popTight()Remove the last "tight" setting from the top of the stack. -
isTight
private boolean isTight() -
writePrefixes
private void writePrefixes() -
flushBlockSeparator
private void flushBlockSeparator()If a block separator has been enqueued withblock()but not yet written, write it now. -
append
-
append
private void append(char c)
-