Added test for quotations
This commit is contained in:
parent
bcfb07e5c3
commit
2949830f0c
|
|
@ -310,9 +310,9 @@ table_separator = pp.OneOrMore(
|
|||
pps('|') + pp.Word(':-')
|
||||
)('table_separator').add_parse_action(of_type(TableSeparatorToken)) + pps('|')
|
||||
# Future: Add Blockquote element
|
||||
blockquote = pp.LineStart + '>' + \
|
||||
blockquote = pp.Literal('>') + \
|
||||
pp.SkipTo(pp.line_end)('text').add_parse_action(of_type(BlockQuoteToken)) # TODO: add reparse
|
||||
blockquote_author = pp.LineStart + '> --' + \
|
||||
blockquote_author = pp.Literal('> --') + \
|
||||
pp.SkipTo(pp.line_end)('author').add_parse_action(of_type(BlockQuoteAuthorToken))
|
||||
table = table_separator | table_row
|
||||
quotation = blockquote_author | blockquote
|
||||
|
|
|
|||
|
|
@ -527,6 +527,44 @@ dict_advanced_syntax_input_and_expected_output = {
|
|||
]),
|
||||
), __GL(),),
|
||||
],
|
||||
"blockquote": [
|
||||
("> Text", (sy.BlockQuoteToken([sy.TextToken(["Text"])]),), __GL(), __XF),
|
||||
("> Text with *em* and __underline__", (
|
||||
sy.BlockQuoteToken([
|
||||
sy.TextToken(["Text with"]),
|
||||
sy.EtEmToken(["*"]),
|
||||
sy.TextToken(["em"]),
|
||||
sy.EtEmToken(["*"]),
|
||||
sy.TextToken(["and"]),
|
||||
sy.EtUnderlineToken(["__"]),
|
||||
sy.TextToken(["underline"]),
|
||||
sy.EtUnderlineToken(["__"]),
|
||||
]),
|
||||
), __GL(), __XF),
|
||||
],
|
||||
"blockquote_author": [
|
||||
("> -- Author Name", (
|
||||
sy.BlockQuoteAuthorToken(["Author Name"]),
|
||||
), __GL(), __XF),
|
||||
],
|
||||
"quotation": [
|
||||
("> Text", (sy.BlockQuoteToken([sy.TextToken(["Text"])]),), __GL(), __XF),
|
||||
("> Text with *em* and __underline__", (
|
||||
sy.BlockQuoteToken([
|
||||
sy.TextToken(["Text with"]),
|
||||
sy.EtEmToken(["*"]),
|
||||
sy.TextToken(["em"]),
|
||||
sy.EtEmToken(["*"]),
|
||||
sy.TextToken(["and"]),
|
||||
sy.EtUnderlineToken(["__"]),
|
||||
sy.TextToken(["underline"]),
|
||||
sy.EtUnderlineToken(["__"]),
|
||||
]),
|
||||
), __GL(), __XF),
|
||||
("> -- Author Name", (
|
||||
sy.BlockQuoteAuthorToken(["Author Name"]),
|
||||
), __GL(), __XF),
|
||||
],
|
||||
}
|
||||
|
||||
# Cursed zipping oneline
|
||||
|
|
|
|||
Loading…
Reference in New Issue