Class Block
java.lang.Object
com.github.rjeschke.txtmark.Block
This class represents a block of lines.
-
Field Summary
FieldsModifier and TypeFieldDescriptionHead and tail of child blocks.Head and tail of child blocks.intDepth of headline BlockType.ID for headlines and list itemsHead and tail of linked lines.Head and tail of linked lines.Block meta informationNext block.This block's type. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidappendLine(Line line) Appends the given line to this block.voidChanges all Blocks of typeNONEtoPARAGRAPHif this Block is a List and any of the ListItems contains a paragraph.booleanhasLines()voidUsed for nested block quotes.booleanRemoves leading empty lines.voidremoveLine(Line line) Removes the given line from this block.voidremoveListIndent(Configuration configuration) Used for nested lists.voidRemoves leading and trailing empty lines.voidRemoves trailing empty lines.Splits this block's lines, creating a new child block having 'line' as it's lineTail.voidSetshlDepthand takes care of '#' chars.
-
Field Details
-
type
This block's type. -
lines
Head and tail of linked lines. -
lineTail
Head and tail of linked lines. -
blocks
Head and tail of child blocks. -
blockTail
Head and tail of child blocks. -
next
Next block. -
hlDepth
public int hlDepthDepth of headline BlockType. -
id
ID for headlines and list items -
meta
Block meta information
-
-
Constructor Details
-
Block
public Block()Constructor.
-
-
Method Details
-
hasLines
public boolean hasLines()- Returns:
trueif this block contains lines.
-
removeSurroundingEmptyLines
public void removeSurroundingEmptyLines()Removes leading and trailing empty lines. -
transfromHeadline
public void transfromHeadline()SetshlDepthand takes care of '#' chars. -
removeListIndent
Used for nested lists. Removes list markers and up to 4 leading spaces.- Parameters:
configuration- txtmark configuration
-
removeBlockQuotePrefix
public void removeBlockQuotePrefix()Used for nested block quotes. Removes '>' char. -
removeLeadingEmptyLines
public boolean removeLeadingEmptyLines()Removes leading empty lines.- Returns:
trueif an empty line was removed.
-
removeTrailingEmptyLines
public void removeTrailingEmptyLines()Removes trailing empty lines. -
split
-
removeLine
Removes the given line from this block.- Parameters:
line- Line to remove.
-
appendLine
Appends the given line to this block.- Parameters:
line- Line to append.
-
expandListParagraphs
public void expandListParagraphs()Changes all Blocks of typeNONEtoPARAGRAPHif this Block is a List and any of the ListItems contains a paragraph.
-