Package com.teamten.markdown
Class MarkdownParser
java.lang.Object
com.teamten.markdown.MarkdownParser
Parses a Markdown file into a DOM.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
parse
(InputStream inputStream) static Doc
Parse a doc from a string.static Block
parseSingleBlock
(String text) Parse a single block from a string, returning the block.void
setForceBody
(boolean forceBody) Whether to force the parse as a body block.
-
Constructor Details
-
MarkdownParser
public MarkdownParser()
-
-
Method Details
-
main
- Throws:
IOException
-
setForceBody
public void setForceBody(boolean forceBody) Whether to force the parse as a body block. Setting this to true causes characters like # to be treated like any other. Defaults to false. -
parse
- Throws:
IOException
-
parseSingleBlock
Parse a single block from a string, returning the block. This does not support comments in the Markdown.- Throws:
IllegalArgumentException
- if the text cannot be parsed to exactly one block.
-
parseDoc
Parse a doc from a string. This does not support comments in the Markdown.
-