@Component(role=Parser.class, hint="markdown") public class MarkdownParser extends AbstractParser
Implementation of Parser
for Markdown documents.
Defers effective parsing to the flexmark-java library, which generates HTML content then delegates parsing of this content to a slightly modified Doxia Xhtml parser. (before 1.8, the PegDown library was used)
Modifier and Type | Class and Description |
---|---|
static class |
MarkdownParser.MarkdownHtmlParser
Internal parser for HTML generated by the Markdown library.
|
Modifier and Type | Field and Description |
---|---|
static String |
ROLE_HINT
The role hint for the
MarkdownParser Plexus component. |
ROLE, TXT_TYPE, UNKNOWN_TYPE, XML_TYPE
Constructor and Description |
---|
MarkdownParser() |
Modifier and Type | Method and Description |
---|---|
int |
getType()
getType.
|
void |
parse(Reader source,
Sink sink,
String reference)
Parses the given source model and emits Doxia events into the given sink.
|
doxiaVersion, enableLogging, executeMacro, getBasedir, getLog, getMacroManager, init, isEmitComments, isSecondParsing, parse, parse, parse, setEmitComments, setSecondParsing
public static final String ROLE_HINT
MarkdownParser
Plexus component.public MarkdownParser()
public int getType()
getType.
getType
in interface Parser
getType
in class AbstractParser
public void parse(Reader source, Sink sink, String reference) throws ParseException
source
- not null reader that provides the source document.
You could use newReader
methods from ReaderFactory
.sink
- A sink that consumes the Doxia events.reference
- the referenceParseException
- if the model could not be parsed.Copyright © 2005–2021 The Apache Software Foundation. All rights reserved.