Package com.vladsch.flexmark.parser.core
Class HtmlBlockParser
- java.lang.Object
-
- com.vladsch.flexmark.parser.block.AbstractBlockParser
-
- com.vladsch.flexmark.parser.core.HtmlBlockParser
-
- All Implemented Interfaces:
BlockParser
public class HtmlBlockParser extends AbstractBlockParser
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classHtmlBlockParser.BlockFactorystatic classHtmlBlockParser.Factoryprivate static classHtmlBlockParser.Patterns
-
Field Summary
Fields Modifier and Type Field Description private HtmlBlockBaseblockprivate java.util.regex.PatternclosingPatternprivate BlockContentcontentprivate HtmlDeepParserdeepParserprivate booleanfinishedstatic java.lang.StringHTML_COMMENT_CLOSEstatic java.lang.StringHTML_COMMENT_OPENprivate booleanmyHtmlBlockDeepParseBlankLineInterruptsprivate booleanmyHtmlBlockDeepParseBlankLineInterruptsPartialTagprivate booleanmyHtmlBlockDeepParseIndentedCodeInterruptsprivate booleanmyHtmlBlockDeepParseMarkdownInterruptsClosedprivate booleanmyHtmlBlockDeepParseNonBlockprivate booleanparseInnerHtmlComments
-
Constructor Summary
Constructors Constructor Description HtmlBlockParser(DataHolder options, java.util.regex.Pattern closingPattern, boolean isComment, HtmlDeepParser deepParser)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddLine(ParserState state, BasedSequence line)Add another line to the blockbooleancanContain(ParserState state, BlockParser blockParser, Block block)booleancanInterruptBy(BlockParserFactory blockParserFactory)Allows block parsers to determine if they can be interrupted by other block parsersvoidcloseBlock(ParserState state)BlockgetBlock()booleanisInterruptible()Allows block parsers to be interrupted by other block parsersbooleanisRawText()Allows block parsers to keep indenting spaces for those blocks that are interruptible but don't want indenting spaces removed.BlockContinuetryContinue(ParserState state)See if the block parser can continue parsing the current block-
Methods inherited from class com.vladsch.flexmark.parser.block.AbstractBlockParser
breakOutOnDoubleBlankLine, finalizeClosedBlock, getBlockContent, getDataHolder, isClosed, isContainer, isParagraphParser, isPropagatingLastBlankLine, parseInlines, removeBlankLines
-
-
-
-
Field Detail
-
HTML_COMMENT_OPEN
public static final java.lang.String HTML_COMMENT_OPEN
- See Also:
- Constant Field Values
-
HTML_COMMENT_CLOSE
public static final java.lang.String HTML_COMMENT_CLOSE
- See Also:
- Constant Field Values
-
block
private final HtmlBlockBase block
-
closingPattern
private final java.util.regex.Pattern closingPattern
-
deepParser
private final HtmlDeepParser deepParser
-
finished
private boolean finished
-
content
private BlockContent content
-
parseInnerHtmlComments
private final boolean parseInnerHtmlComments
-
myHtmlBlockDeepParseNonBlock
private final boolean myHtmlBlockDeepParseNonBlock
-
myHtmlBlockDeepParseBlankLineInterrupts
private final boolean myHtmlBlockDeepParseBlankLineInterrupts
-
myHtmlBlockDeepParseMarkdownInterruptsClosed
private final boolean myHtmlBlockDeepParseMarkdownInterruptsClosed
-
myHtmlBlockDeepParseBlankLineInterruptsPartialTag
private final boolean myHtmlBlockDeepParseBlankLineInterruptsPartialTag
-
myHtmlBlockDeepParseIndentedCodeInterrupts
private final boolean myHtmlBlockDeepParseIndentedCodeInterrupts
-
-
Constructor Detail
-
HtmlBlockParser
HtmlBlockParser(DataHolder options, java.util.regex.Pattern closingPattern, boolean isComment, HtmlDeepParser deepParser)
-
-
Method Detail
-
getBlock
public Block getBlock()
- Returns:
- the block parser's block node instance
-
tryContinue
public BlockContinue tryContinue(ParserState state)
Description copied from interface:BlockParserSee if the block parser can continue parsing the current block- Parameters:
state- current parsing state- Returns:
- block continue instance
-
addLine
public void addLine(ParserState state, BasedSequence line)
Description copied from interface:BlockParserAdd another line to the block- Specified by:
addLinein interfaceBlockParser- Overrides:
addLinein classAbstractBlockParser- Parameters:
state- parser stateline- line sequence
-
canInterruptBy
public boolean canInterruptBy(BlockParserFactory blockParserFactory)
Description copied from interface:BlockParserAllows block parsers to determine if they can be interrupted by other block parsers- Specified by:
canInterruptByin interfaceBlockParser- Overrides:
canInterruptByin classAbstractBlockParser- Parameters:
blockParserFactory- interrupting block parser- Returns:
- true if can interrupt.
-
canContain
public boolean canContain(ParserState state, BlockParser blockParser, Block block)
- Specified by:
canContainin interfaceBlockParser- Overrides:
canContainin classAbstractBlockParser- Parameters:
state- parser stateblockParser- block parserblock- new block being started @return true if this block parser's block can contain the given block type, false if it cannot
-
isInterruptible
public boolean isInterruptible()
Description copied from interface:BlockParserAllows block parsers to be interrupted by other block parsers- Specified by:
isInterruptiblein interfaceBlockParser- Overrides:
isInterruptiblein classAbstractBlockParser- Returns:
- true if block starts should be tried when this block parser is active
-
isRawText
public boolean isRawText()
Description copied from interface:BlockParserAllows block parsers to keep indenting spaces for those blocks that are interruptible but don't want indenting spaces removed.- Specified by:
isRawTextin interfaceBlockParser- Overrides:
isRawTextin classAbstractBlockParser- Returns:
- true if block wants to keep indenting spaces
-
closeBlock
public void closeBlock(ParserState state)
-
-