markdown2 $ MdBlockQuoteParserFactory :: SELF
Type of this instance, automatically specialized in every classmarkdown2 $ MdBlockQuoteParserFactory :: try_start
Can the associated block parser can start at the current line inparser
?
core :: Object :: class_factory
Implementation used byget_class
to create the specific class.
core :: Object :: defaultinit
core :: Object :: is_same_instance
Return true ifself
and other
are the same instance (i.e. same identity).
core :: Object :: is_same_serialized
Isself
the same as other
in a serialization context?
core :: Object :: is_same_type
Return true ifself
and other
have the same dynamic type.
core :: Object :: output_class_name
Display class name on stdout (debug only).markdown2 :: MdBlockParserFactory :: try_start
Can the associated block parser can start at the current line inparser
?
markdown2 :: MdBlockParserFactory
Block parser factory for a block node for determining when a block startsmarkdown2 :: MdFencedCodeBlockParserFactory
Fenced code blocks parser factorymarkdown2 :: MdThematicBreakParserFactory
Thematic breaks parser factory
# Blockquotes parser factory
class MdBlockQuoteParserFactory
super MdBlockParserFactory
redef fun try_start(state, matched_block_parser) do
var next_non_space = state.next_non_space_index
var indent = state.indent
var line = state.line_string
if indent >= 4 then return null
if next_non_space >= line.length then return null
if line.chars[next_non_space] != '>' then return null
var new_column = state.column + state.indent + 1
# optional following space or tab
if state.line_string.is_space_or_tab(next_non_space + 1) then
new_column += 1
end
return (new MdBlockStart(
[new MdBlockQuoteParser(
state.line,
state.column + 1,
new_column)])
).at_column(new_column)
end
end
lib/markdown2/markdown_block_parsing.nit:753,1--778,3