added reparsing
This commit is contained in:
parent
c07d61ba12
commit
7aae84e916
|
|
@ -304,15 +304,15 @@ se = se_end | se_start # Structural element
|
||||||
table_row = pp.OneOrMore(
|
table_row = pp.OneOrMore(
|
||||||
# pp.Regex(r'\|(\d)?')('table_colspan') +
|
# pp.Regex(r'\|(\d)?')('table_colspan') +
|
||||||
(pp.Combine(pps('|') + pp.Word(pp.nums)('table_colspan')) | pps('|')) +
|
(pp.Combine(pps('|') + pp.Word(pp.nums)('table_colspan')) | pps('|')) +
|
||||||
pp.SkipTo('|')('table_cell').add_parse_action(of_type(TableCellToken)) # TODO: add reparse
|
pp.SkipTo('|')('table_cell').add_parse_action(reparse(enhanced_text), of_type(TableCellToken))
|
||||||
).add_parse_action(of_type(TableRowToken)) + pps('|') + pp.Opt(optional)
|
).add_parse_action(of_type(TableRowToken)) + pps('|') + pp.Opt(optional)
|
||||||
table_separator = pp.OneOrMore(
|
table_separator = pp.OneOrMore(
|
||||||
pps('|') + pp.Word(':-')
|
pps('|') + pp.Word(':-')
|
||||||
)('table_separator').add_parse_action(of_type(TableSeparatorToken)) + pps('|')
|
)('table_separator').add_parse_action(of_type(TableSeparatorToken)) + pps('|')
|
||||||
# Future: Add Blockquote element
|
# Future: Add Blockquote element
|
||||||
blockquote = pp.Literal('>') + \
|
blockquote = pps(pp.Literal('>')) + \
|
||||||
pp.SkipTo(pp.line_end)('text').add_parse_action(of_type(BlockQuoteToken)) # TODO: add reparse
|
pp.SkipTo(pp.line_end)('text').add_parse_action(reparse(enhanced_text), of_type(BlockQuoteToken))
|
||||||
blockquote_author = pp.Literal('> --') + \
|
blockquote_author = pps(pp.Literal('> --')) + \
|
||||||
pp.SkipTo(pp.line_end)('author').add_parse_action(of_type(BlockQuoteAuthorToken))
|
pp.SkipTo(pp.line_end)('author').add_parse_action(of_type(BlockQuoteAuthorToken))
|
||||||
table = table_separator | table_row
|
table = table_separator | table_row
|
||||||
quotation = blockquote_author | blockquote
|
quotation = blockquote_author | blockquote
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue