Package com.teamten.markdown
Class Block
java.lang.Object
com.teamten.markdown.Block
A block is a paragraph (similar to a block in HTML DOM). It's a sequence of spans.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Builds a Block one character at a time. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
static Block
Make a plain body block from a string.boolean
@NotNull BlockType
int
Get the counter for numbered lists.int
Get line in source where this block started.@Nullable SectionName
Return the first section name span in this block, if any.Return the shortened version of the block, if specified using a SHORTENED tag, otherwise the normal block text.getSpans()
getText()
Return a string version of all text spans.int
hashCode()
boolean
Whether this block is inside a blockquote (indented, etc.).static Block.Builder
numberedListBuilder
(int lineNumber, int counter, boolean inBlockQuote) Make a builder for numbered lists.void
postProcessText
(String locale) Convert apostrophes, quotes, etc.Return just the text of the block.toString()
withBlockType
(BlockType blockType) Return a copy of this block with a different block type.
-
Constructor Details
-
Block
public Block(@NotNull @NotNull BlockType blockType, int lineNumber, int counter, boolean inBlockQuote)
-
-
Method Details
-
getBlockType
-
getLineNumber
public int getLineNumber()Get line in source where this block started. -
getCounter
public int getCounter()Get the counter for numbered lists. -
isInBlockQuote
public boolean isInBlockQuote()Whether this block is inside a blockquote (indented, etc.). -
getSpans
-
getText
Return a string version of all text spans. Ignores non-text spans. -
getShortenedText
Return the shortened version of the block, if specified using a SHORTENED tag, otherwise the normal block text. -
getSectionName
Return the first section name span in this block, if any. -
addSpan
-
withBlockType
Return a copy of this block with a different block type. -
postProcessText
Convert apostrophes, quotes, etc.- Parameters:
locale
- the locale being processed ("en_US", "fr", etc.).
-
toBriefString
Return just the text of the block. -
toString
-
equals
-
hashCode
public int hashCode() -
numberedListBuilder
Make a builder for numbered lists. -
bodyBlock
Make a plain body block from a string.
-