From e00b7e1017a1e02c74e67d73bb7cd933fb51c896 Mon Sep 17 00:00:00 2001 From: Xavier Coulon Date: Sat, 28 Oct 2017 18:16:12 +0200 Subject: [PATCH] feat(parser): support double punctuation in quoted text Signed-off-by: Xavier Coulon --- parser/asciidoc-grammar.peg | 52 ++- parser/asciidoc_parser.go | 835 +++++++++++++++++++++--------------- parser/quoted_text_test.go | 80 +++- 3 files changed, 597 insertions(+), 370 deletions(-) diff --git a/parser/asciidoc-grammar.peg b/parser/asciidoc-grammar.peg index 935d1032..c99ac3d8 100644 --- a/parser/asciidoc-grammar.peg +++ b/parser/asciidoc-grammar.peg @@ -110,7 +110,7 @@ DocumentAttributeSubstitution <- "{" name:(AttributeName) "}" { // AttributeName must be at least one character long, // must begin with a word character (A-Z, a-z, 0-9 or _) and -// must only contain word characters and hyphens ('-'). +// must only contain word characters and hyphens ("-"). AttributeName <- ([A-Z] / [a-z] / [0-9] / "_") ([A-Z] / [a-z] / [0-9] / "-")* // ------------------------------------------ @@ -194,11 +194,11 @@ List <- attributes:(ElementAttribute)* return types.NewList(elements.([]interface{}), attributes.([]interface{})) } -ListItem <- WS* level:('*'+ / '-') WS+ content:(ListItemContent) { +ListItem <- WS* level:("*"+ / "-") WS+ content:(ListItemContent) { return types.NewListItem(level, content.(*types.ListItemContent), nil) } -ListItemContent <- lines:(!(WS* ('*'+ / '-') WS+) InlineContent EOL)+ { +ListItemContent <- lines:(!(WS* ("*"+ / "-") WS+) InlineContent EOL)+ { return types.NewListItemContent(c.text, lines.([]interface{})) } // ------------------------------------------ @@ -212,7 +212,7 @@ Paragraph <- attributes:(ElementAttribute)* !("="+ WS+) lines:(InlineContent EOL // an inline content element may start with and end with spaces, // but it must contain at least an inline element (image, quoted text, external link, document attribute substitution, word, etc.) -InlineContent <- !FencedBlockDelimiter elements:(WS* InlineElement WS*)+ &EOL { // needs an 'EOL' but does not consume it here. +InlineContent <- !FencedBlockDelimiter elements:(WS* InlineElement WS*)+ &EOL { // needs an "EOL" but does not consume it here. return types.NewInlineContent(c.text, elements.([]interface{})) } @@ -221,17 +221,31 @@ InlineElement <- InlineImage / QuotedText / ExternalLink / DocumentAttributeSubs // ------------------------------------------ // Quoted Texts (bold, italic and monospace) // ------------------------------------------ -QuotedText <- BoldText / ItalicText / MonospaceText +QuotedText <- BoldTextDoublePunctuation / BoldTextSimplePunctuation // double punctuation must be evaluated first + / ItalicTextDoublePunctuation / ItalicTextSimplePunctuation + / MonospaceTextDoublePunctuation / MonospaceTextSimplePunctuation -BoldText <- '*' content:(QuotedTextContent) '*' { +BoldTextSimplePunctuation <- "*" content:(QuotedTextContent) "*" { return types.NewQuotedText(types.Bold, content.([]interface{})) } -ItalicText <- '_' content:(QuotedTextContent) '_' { +BoldTextDoublePunctuation <- "**" content:(QuotedTextContent) "**" { + return types.NewQuotedText(types.Bold, content.([]interface{})) +} + +ItalicTextSimplePunctuation <- "_" content:(QuotedTextContent) "_" { return types.NewQuotedText(types.Italic, content.([]interface{})) } -MonospaceText <- '`' content:(QuotedTextContent) '`' { +ItalicTextDoublePunctuation <- "__" content:(QuotedTextContent) "__" { + return types.NewQuotedText(types.Italic, content.([]interface{})) +} + +MonospaceTextSimplePunctuation <- "`" content:(QuotedTextContent) "`" { + return types.NewQuotedText(types.Monospace, content.([]interface{})) +} + +MonospaceTextDoublePunctuation <- "``" content:(QuotedTextContent) "``" { return types.NewQuotedText(types.Monospace, content.([]interface{})) } @@ -239,13 +253,13 @@ QuotedTextContent <- QuotedTextContentElement (WS+ QuotedTextContentElement)* QuotedTextContentElement <- QuotedText / QuotedTextContentWord / InvalidQuotedTextContentWord -QuotedTextContentWord <- (!NEWLINE !WS !'*' !'_' !'`' .)+ // cannot have '*', '_' or '`' within -InvalidQuotedTextContentWord <- (!NEWLINE !WS .)+ // can have '*', '_' or '`' within, maybe because the user made an error (extra or missing space, for example) +QuotedTextContentWord <- (!NEWLINE !WS !"*" !"_" !"`" .)+ // cannot have "*", "_" or "`" within +InvalidQuotedTextContentWord <- (!NEWLINE !WS .)+ // can have "*", "_" or "`" within, maybe because the user made an error (extra or missing space, for example) // ------------------------------------------ // Links // ------------------------------------------ -ExternalLink <- url:(URL_SCHEME URL) text:('[' (URL_TEXT)* ']')? { +ExternalLink <- url:(URL_SCHEME URL) text:("[" (URL_TEXT)* "]")? { if text != nil { return types.NewExternalLink(url.([]interface{}), text.([]interface{})) } @@ -260,7 +274,7 @@ BlockImage <- attributes:(ElementAttribute)* image:BlockImageMacro WS* EOL { return types.NewBlockImage(c.text, *image.(*types.ImageMacro), attributes.([]interface{})) } -BlockImageMacro <- "image::" path:(URL) '[' attributes:(URL_TEXT?) ']' { +BlockImageMacro <- "image::" path:(URL) "[" attributes:(URL_TEXT?) "]" { return types.NewImageMacro(c.text, path.(string), attributes) } @@ -269,7 +283,7 @@ InlineImage <- image:InlineImageMacro { return types.NewInlineImage(c.text, *image.(*types.ImageMacro)) } -InlineImageMacro <- "image:" !":" path:(URL) '[' attributes:(URL_TEXT?) ']' { +InlineImageMacro <- "image:" !":" path:(URL) "[" attributes:(URL_TEXT?) "]" { return types.NewImageMacro(c.text, path.(string), attributes) } @@ -328,12 +342,12 @@ ElementLink <- "[" WS* "link" WS* "=" WS* path:URL WS* "]" EOL { } // an id attached to an element, such as a BlockImage -ElementID <- "[" WS* '#' id:(ID) WS* "]" EOL { +ElementID <- "[" WS* "#" id:(ID) WS* "]" EOL { return types.NewElementID(id.(string)) } // a title attached to an element, such as a BlockImage ( -// a title starts with a single '.' followed by the value, without space in-between +// a title starts with a single "." followed by the value, without space in-between ElementTitle <- "." !"." !WS title:(!NEWLINE .)+ EOL { return types.NewElementTitle(title.([]interface{})) } @@ -349,15 +363,15 @@ BlankLine <- !EOF WS* EOL { return types.NewBlankLine() } -URL <- (!NEWLINE !WS !'[' !']' .)+ { +URL <- (!NEWLINE !WS !"[" !"]" .)+ { return string(c.text), nil } -ID <- (!NEWLINE !WS !'[' !']' .)+ { +ID <- (!NEWLINE !WS !"[" !"]" .)+ { return string(c.text), nil } -URL_TEXT <- (!NEWLINE !'[' !']' .)+ { +URL_TEXT <- (!NEWLINE !"[" !"]" .)+ { return string(c.text), nil } @@ -367,7 +381,7 @@ DIGIT <- [0-9] NEWLINE <- "\r\n" / "\r" / "\n" -WS <- ' ' / '\t' { +WS <- " " / "\t" { return string(c.text), nil } diff --git a/parser/asciidoc_parser.go b/parser/asciidoc_parser.go index a5a69f35..b50a3200 100644 --- a/parser/asciidoc_parser.go +++ b/parser/asciidoc_parser.go @@ -2375,47 +2375,59 @@ var g = &grammar{ name: "QuotedText", pos: position{line: 224, col: 1, offset: 9481}, expr: &choiceExpr{ - pos: position{line: 224, col: 15, offset: 9495}, + pos: position{line: 224, col: 16, offset: 9496}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 224, col: 15, offset: 9495}, - name: "BoldText", + pos: position{line: 224, col: 16, offset: 9496}, + name: "BoldTextDoublePunctuation", }, &ruleRefExpr{ - pos: position{line: 224, col: 26, offset: 9506}, - name: "ItalicText", + pos: position{line: 224, col: 44, offset: 9524}, + name: "BoldTextSimplePunctuation", }, &ruleRefExpr{ - pos: position{line: 224, col: 39, offset: 9519}, - name: "MonospaceText", + pos: position{line: 225, col: 15, offset: 9610}, + name: "ItalicTextDoublePunctuation", + }, + &ruleRefExpr{ + pos: position{line: 225, col: 45, offset: 9640}, + name: "ItalicTextSimplePunctuation", + }, + &ruleRefExpr{ + pos: position{line: 226, col: 15, offset: 9682}, + name: "MonospaceTextDoublePunctuation", + }, + &ruleRefExpr{ + pos: position{line: 226, col: 48, offset: 9715}, + name: "MonospaceTextSimplePunctuation", }, }, }, }, { - name: "BoldText", - pos: position{line: 226, col: 1, offset: 9534}, + name: "BoldTextSimplePunctuation", + pos: position{line: 228, col: 1, offset: 9747}, expr: &actionExpr{ - pos: position{line: 226, col: 13, offset: 9546}, - run: (*parser).callonBoldText1, + pos: position{line: 228, col: 30, offset: 9776}, + run: (*parser).callonBoldTextSimplePunctuation1, expr: &seqExpr{ - pos: position{line: 226, col: 13, offset: 9546}, + pos: position{line: 228, col: 30, offset: 9776}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 226, col: 13, offset: 9546}, + pos: position{line: 228, col: 30, offset: 9776}, val: "*", ignoreCase: false, }, &labeledExpr{ - pos: position{line: 226, col: 17, offset: 9550}, + pos: position{line: 228, col: 34, offset: 9780}, label: "content", expr: &ruleRefExpr{ - pos: position{line: 226, col: 26, offset: 9559}, + pos: position{line: 228, col: 43, offset: 9789}, name: "QuotedTextContent", }, }, &litMatcher{ - pos: position{line: 226, col: 45, offset: 9578}, + pos: position{line: 228, col: 62, offset: 9808}, val: "*", ignoreCase: false, }, @@ -2424,29 +2436,60 @@ var g = &grammar{ }, }, { - name: "ItalicText", - pos: position{line: 230, col: 1, offset: 9655}, + name: "BoldTextDoublePunctuation", + pos: position{line: 232, col: 1, offset: 9885}, + expr: &actionExpr{ + pos: position{line: 232, col: 30, offset: 9914}, + run: (*parser).callonBoldTextDoublePunctuation1, + expr: &seqExpr{ + pos: position{line: 232, col: 30, offset: 9914}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 232, col: 30, offset: 9914}, + val: "**", + ignoreCase: false, + }, + &labeledExpr{ + pos: position{line: 232, col: 35, offset: 9919}, + label: "content", + expr: &ruleRefExpr{ + pos: position{line: 232, col: 44, offset: 9928}, + name: "QuotedTextContent", + }, + }, + &litMatcher{ + pos: position{line: 232, col: 63, offset: 9947}, + val: "**", + ignoreCase: false, + }, + }, + }, + }, + }, + { + name: "ItalicTextSimplePunctuation", + pos: position{line: 236, col: 1, offset: 10025}, expr: &actionExpr{ - pos: position{line: 230, col: 15, offset: 9669}, - run: (*parser).callonItalicText1, + pos: position{line: 236, col: 32, offset: 10056}, + run: (*parser).callonItalicTextSimplePunctuation1, expr: &seqExpr{ - pos: position{line: 230, col: 15, offset: 9669}, + pos: position{line: 236, col: 32, offset: 10056}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 230, col: 15, offset: 9669}, + pos: position{line: 236, col: 32, offset: 10056}, val: "_", ignoreCase: false, }, &labeledExpr{ - pos: position{line: 230, col: 19, offset: 9673}, + pos: position{line: 236, col: 36, offset: 10060}, label: "content", expr: &ruleRefExpr{ - pos: position{line: 230, col: 28, offset: 9682}, + pos: position{line: 236, col: 45, offset: 10069}, name: "QuotedTextContent", }, }, &litMatcher{ - pos: position{line: 230, col: 47, offset: 9701}, + pos: position{line: 236, col: 64, offset: 10088}, val: "_", ignoreCase: false, }, @@ -2455,29 +2498,60 @@ var g = &grammar{ }, }, { - name: "MonospaceText", - pos: position{line: 234, col: 1, offset: 9780}, + name: "ItalicTextDoublePunctuation", + pos: position{line: 240, col: 1, offset: 10167}, expr: &actionExpr{ - pos: position{line: 234, col: 18, offset: 9797}, - run: (*parser).callonMonospaceText1, + pos: position{line: 240, col: 32, offset: 10198}, + run: (*parser).callonItalicTextDoublePunctuation1, expr: &seqExpr{ - pos: position{line: 234, col: 18, offset: 9797}, + pos: position{line: 240, col: 32, offset: 10198}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 234, col: 18, offset: 9797}, + pos: position{line: 240, col: 32, offset: 10198}, + val: "__", + ignoreCase: false, + }, + &labeledExpr{ + pos: position{line: 240, col: 37, offset: 10203}, + label: "content", + expr: &ruleRefExpr{ + pos: position{line: 240, col: 46, offset: 10212}, + name: "QuotedTextContent", + }, + }, + &litMatcher{ + pos: position{line: 240, col: 65, offset: 10231}, + val: "__", + ignoreCase: false, + }, + }, + }, + }, + }, + { + name: "MonospaceTextSimplePunctuation", + pos: position{line: 244, col: 1, offset: 10311}, + expr: &actionExpr{ + pos: position{line: 244, col: 35, offset: 10345}, + run: (*parser).callonMonospaceTextSimplePunctuation1, + expr: &seqExpr{ + pos: position{line: 244, col: 35, offset: 10345}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 244, col: 35, offset: 10345}, val: "`", ignoreCase: false, }, &labeledExpr{ - pos: position{line: 234, col: 22, offset: 9801}, + pos: position{line: 244, col: 39, offset: 10349}, label: "content", expr: &ruleRefExpr{ - pos: position{line: 234, col: 31, offset: 9810}, + pos: position{line: 244, col: 48, offset: 10358}, name: "QuotedTextContent", }, }, &litMatcher{ - pos: position{line: 234, col: 50, offset: 9829}, + pos: position{line: 244, col: 67, offset: 10377}, val: "`", ignoreCase: false, }, @@ -2485,30 +2559,61 @@ var g = &grammar{ }, }, }, + { + name: "MonospaceTextDoublePunctuation", + pos: position{line: 248, col: 1, offset: 10459}, + expr: &actionExpr{ + pos: position{line: 248, col: 35, offset: 10493}, + run: (*parser).callonMonospaceTextDoublePunctuation1, + expr: &seqExpr{ + pos: position{line: 248, col: 35, offset: 10493}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 248, col: 35, offset: 10493}, + val: "``", + ignoreCase: false, + }, + &labeledExpr{ + pos: position{line: 248, col: 40, offset: 10498}, + label: "content", + expr: &ruleRefExpr{ + pos: position{line: 248, col: 49, offset: 10507}, + name: "QuotedTextContent", + }, + }, + &litMatcher{ + pos: position{line: 248, col: 68, offset: 10526}, + val: "``", + ignoreCase: false, + }, + }, + }, + }, + }, { name: "QuotedTextContent", - pos: position{line: 238, col: 1, offset: 9911}, + pos: position{line: 252, col: 1, offset: 10609}, expr: &seqExpr{ - pos: position{line: 238, col: 22, offset: 9932}, + pos: position{line: 252, col: 22, offset: 10630}, exprs: []interface{}{ &ruleRefExpr{ - pos: position{line: 238, col: 22, offset: 9932}, + pos: position{line: 252, col: 22, offset: 10630}, name: "QuotedTextContentElement", }, &zeroOrMoreExpr{ - pos: position{line: 238, col: 47, offset: 9957}, + pos: position{line: 252, col: 47, offset: 10655}, expr: &seqExpr{ - pos: position{line: 238, col: 48, offset: 9958}, + pos: position{line: 252, col: 48, offset: 10656}, exprs: []interface{}{ &oneOrMoreExpr{ - pos: position{line: 238, col: 48, offset: 9958}, + pos: position{line: 252, col: 48, offset: 10656}, expr: &ruleRefExpr{ - pos: position{line: 238, col: 48, offset: 9958}, + pos: position{line: 252, col: 48, offset: 10656}, name: "WS", }, }, &ruleRefExpr{ - pos: position{line: 238, col: 52, offset: 9962}, + pos: position{line: 252, col: 52, offset: 10660}, name: "QuotedTextContentElement", }, }, @@ -2519,20 +2624,20 @@ var g = &grammar{ }, { name: "QuotedTextContentElement", - pos: position{line: 240, col: 1, offset: 9990}, + pos: position{line: 254, col: 1, offset: 10688}, expr: &choiceExpr{ - pos: position{line: 240, col: 29, offset: 10018}, + pos: position{line: 254, col: 29, offset: 10716}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 240, col: 29, offset: 10018}, + pos: position{line: 254, col: 29, offset: 10716}, name: "QuotedText", }, &ruleRefExpr{ - pos: position{line: 240, col: 42, offset: 10031}, + pos: position{line: 254, col: 42, offset: 10729}, name: "QuotedTextContentWord", }, &ruleRefExpr{ - pos: position{line: 240, col: 66, offset: 10055}, + pos: position{line: 254, col: 66, offset: 10753}, name: "InvalidQuotedTextContentWord", }, }, @@ -2540,52 +2645,52 @@ var g = &grammar{ }, { name: "QuotedTextContentWord", - pos: position{line: 242, col: 1, offset: 10085}, + pos: position{line: 256, col: 1, offset: 10783}, expr: &oneOrMoreExpr{ - pos: position{line: 242, col: 26, offset: 10110}, + pos: position{line: 256, col: 26, offset: 10808}, expr: &seqExpr{ - pos: position{line: 242, col: 27, offset: 10111}, + pos: position{line: 256, col: 27, offset: 10809}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 242, col: 27, offset: 10111}, + pos: position{line: 256, col: 27, offset: 10809}, expr: &ruleRefExpr{ - pos: position{line: 242, col: 28, offset: 10112}, + pos: position{line: 256, col: 28, offset: 10810}, name: "NEWLINE", }, }, ¬Expr{ - pos: position{line: 242, col: 36, offset: 10120}, + pos: position{line: 256, col: 36, offset: 10818}, expr: &ruleRefExpr{ - pos: position{line: 242, col: 37, offset: 10121}, + pos: position{line: 256, col: 37, offset: 10819}, name: "WS", }, }, ¬Expr{ - pos: position{line: 242, col: 40, offset: 10124}, + pos: position{line: 256, col: 40, offset: 10822}, expr: &litMatcher{ - pos: position{line: 242, col: 41, offset: 10125}, + pos: position{line: 256, col: 41, offset: 10823}, val: "*", ignoreCase: false, }, }, ¬Expr{ - pos: position{line: 242, col: 45, offset: 10129}, + pos: position{line: 256, col: 45, offset: 10827}, expr: &litMatcher{ - pos: position{line: 242, col: 46, offset: 10130}, + pos: position{line: 256, col: 46, offset: 10828}, val: "_", ignoreCase: false, }, }, ¬Expr{ - pos: position{line: 242, col: 50, offset: 10134}, + pos: position{line: 256, col: 50, offset: 10832}, expr: &litMatcher{ - pos: position{line: 242, col: 51, offset: 10135}, + pos: position{line: 256, col: 51, offset: 10833}, val: "`", ignoreCase: false, }, }, &anyMatcher{ - line: 242, col: 55, offset: 10139, + line: 256, col: 55, offset: 10837, }, }, }, @@ -2593,28 +2698,28 @@ var g = &grammar{ }, { name: "InvalidQuotedTextContentWord", - pos: position{line: 243, col: 1, offset: 10181}, + pos: position{line: 257, col: 1, offset: 10879}, expr: &oneOrMoreExpr{ - pos: position{line: 243, col: 33, offset: 10213}, + pos: position{line: 257, col: 33, offset: 10911}, expr: &seqExpr{ - pos: position{line: 243, col: 34, offset: 10214}, + pos: position{line: 257, col: 34, offset: 10912}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 243, col: 34, offset: 10214}, + pos: position{line: 257, col: 34, offset: 10912}, expr: &ruleRefExpr{ - pos: position{line: 243, col: 35, offset: 10215}, + pos: position{line: 257, col: 35, offset: 10913}, name: "NEWLINE", }, }, ¬Expr{ - pos: position{line: 243, col: 43, offset: 10223}, + pos: position{line: 257, col: 43, offset: 10921}, expr: &ruleRefExpr{ - pos: position{line: 243, col: 44, offset: 10224}, + pos: position{line: 257, col: 44, offset: 10922}, name: "WS", }, }, &anyMatcher{ - line: 243, col: 48, offset: 10228, + line: 257, col: 48, offset: 10926, }, }, }, @@ -2622,52 +2727,52 @@ var g = &grammar{ }, { name: "ExternalLink", - pos: position{line: 248, col: 1, offset: 10445}, + pos: position{line: 262, col: 1, offset: 11143}, expr: &actionExpr{ - pos: position{line: 248, col: 17, offset: 10461}, + pos: position{line: 262, col: 17, offset: 11159}, run: (*parser).callonExternalLink1, expr: &seqExpr{ - pos: position{line: 248, col: 17, offset: 10461}, + pos: position{line: 262, col: 17, offset: 11159}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 248, col: 17, offset: 10461}, + pos: position{line: 262, col: 17, offset: 11159}, label: "url", expr: &seqExpr{ - pos: position{line: 248, col: 22, offset: 10466}, + pos: position{line: 262, col: 22, offset: 11164}, exprs: []interface{}{ &ruleRefExpr{ - pos: position{line: 248, col: 22, offset: 10466}, + pos: position{line: 262, col: 22, offset: 11164}, name: "URL_SCHEME", }, &ruleRefExpr{ - pos: position{line: 248, col: 33, offset: 10477}, + pos: position{line: 262, col: 33, offset: 11175}, name: "URL", }, }, }, }, &labeledExpr{ - pos: position{line: 248, col: 38, offset: 10482}, + pos: position{line: 262, col: 38, offset: 11180}, label: "text", expr: &zeroOrOneExpr{ - pos: position{line: 248, col: 43, offset: 10487}, + pos: position{line: 262, col: 43, offset: 11185}, expr: &seqExpr{ - pos: position{line: 248, col: 44, offset: 10488}, + pos: position{line: 262, col: 44, offset: 11186}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 248, col: 44, offset: 10488}, + pos: position{line: 262, col: 44, offset: 11186}, val: "[", ignoreCase: false, }, &zeroOrMoreExpr{ - pos: position{line: 248, col: 48, offset: 10492}, + pos: position{line: 262, col: 48, offset: 11190}, expr: &ruleRefExpr{ - pos: position{line: 248, col: 49, offset: 10493}, + pos: position{line: 262, col: 49, offset: 11191}, name: "URL_TEXT", }, }, &litMatcher{ - pos: position{line: 248, col: 60, offset: 10504}, + pos: position{line: 262, col: 60, offset: 11202}, val: "]", ignoreCase: false, }, @@ -2681,41 +2786,41 @@ var g = &grammar{ }, { name: "BlockImage", - pos: position{line: 258, col: 1, offset: 10783}, + pos: position{line: 272, col: 1, offset: 11481}, expr: &actionExpr{ - pos: position{line: 258, col: 15, offset: 10797}, + pos: position{line: 272, col: 15, offset: 11495}, run: (*parser).callonBlockImage1, expr: &seqExpr{ - pos: position{line: 258, col: 15, offset: 10797}, + pos: position{line: 272, col: 15, offset: 11495}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 258, col: 15, offset: 10797}, + pos: position{line: 272, col: 15, offset: 11495}, label: "attributes", expr: &zeroOrMoreExpr{ - pos: position{line: 258, col: 26, offset: 10808}, + pos: position{line: 272, col: 26, offset: 11506}, expr: &ruleRefExpr{ - pos: position{line: 258, col: 27, offset: 10809}, + pos: position{line: 272, col: 27, offset: 11507}, name: "ElementAttribute", }, }, }, &labeledExpr{ - pos: position{line: 258, col: 46, offset: 10828}, + pos: position{line: 272, col: 46, offset: 11526}, label: "image", expr: &ruleRefExpr{ - pos: position{line: 258, col: 52, offset: 10834}, + pos: position{line: 272, col: 52, offset: 11532}, name: "BlockImageMacro", }, }, &zeroOrMoreExpr{ - pos: position{line: 258, col: 69, offset: 10851}, + pos: position{line: 272, col: 69, offset: 11549}, expr: &ruleRefExpr{ - pos: position{line: 258, col: 69, offset: 10851}, + pos: position{line: 272, col: 69, offset: 11549}, name: "WS", }, }, &ruleRefExpr{ - pos: position{line: 258, col: 73, offset: 10855}, + pos: position{line: 272, col: 73, offset: 11553}, name: "EOL", }, }, @@ -2724,44 +2829,44 @@ var g = &grammar{ }, { name: "BlockImageMacro", - pos: position{line: 263, col: 1, offset: 11024}, + pos: position{line: 277, col: 1, offset: 11722}, expr: &actionExpr{ - pos: position{line: 263, col: 20, offset: 11043}, + pos: position{line: 277, col: 20, offset: 11741}, run: (*parser).callonBlockImageMacro1, expr: &seqExpr{ - pos: position{line: 263, col: 20, offset: 11043}, + pos: position{line: 277, col: 20, offset: 11741}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 263, col: 20, offset: 11043}, + pos: position{line: 277, col: 20, offset: 11741}, val: "image::", ignoreCase: false, }, &labeledExpr{ - pos: position{line: 263, col: 30, offset: 11053}, + pos: position{line: 277, col: 30, offset: 11751}, label: "path", expr: &ruleRefExpr{ - pos: position{line: 263, col: 36, offset: 11059}, + pos: position{line: 277, col: 36, offset: 11757}, name: "URL", }, }, &litMatcher{ - pos: position{line: 263, col: 41, offset: 11064}, + pos: position{line: 277, col: 41, offset: 11762}, val: "[", ignoreCase: false, }, &labeledExpr{ - pos: position{line: 263, col: 45, offset: 11068}, + pos: position{line: 277, col: 45, offset: 11766}, label: "attributes", expr: &zeroOrOneExpr{ - pos: position{line: 263, col: 57, offset: 11080}, + pos: position{line: 277, col: 57, offset: 11778}, expr: &ruleRefExpr{ - pos: position{line: 263, col: 57, offset: 11080}, + pos: position{line: 277, col: 57, offset: 11778}, name: "URL_TEXT", }, }, }, &litMatcher{ - pos: position{line: 263, col: 68, offset: 11091}, + pos: position{line: 277, col: 68, offset: 11789}, val: "]", ignoreCase: false, }, @@ -2771,15 +2876,15 @@ var g = &grammar{ }, { name: "InlineImage", - pos: position{line: 267, col: 1, offset: 11166}, + pos: position{line: 281, col: 1, offset: 11864}, expr: &actionExpr{ - pos: position{line: 267, col: 16, offset: 11181}, + pos: position{line: 281, col: 16, offset: 11879}, run: (*parser).callonInlineImage1, expr: &labeledExpr{ - pos: position{line: 267, col: 16, offset: 11181}, + pos: position{line: 281, col: 16, offset: 11879}, label: "image", expr: &ruleRefExpr{ - pos: position{line: 267, col: 22, offset: 11187}, + pos: position{line: 281, col: 22, offset: 11885}, name: "InlineImageMacro", }, }, @@ -2787,52 +2892,52 @@ var g = &grammar{ }, { name: "InlineImageMacro", - pos: position{line: 272, col: 1, offset: 11342}, + pos: position{line: 286, col: 1, offset: 12040}, expr: &actionExpr{ - pos: position{line: 272, col: 21, offset: 11362}, + pos: position{line: 286, col: 21, offset: 12060}, run: (*parser).callonInlineImageMacro1, expr: &seqExpr{ - pos: position{line: 272, col: 21, offset: 11362}, + pos: position{line: 286, col: 21, offset: 12060}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 272, col: 21, offset: 11362}, + pos: position{line: 286, col: 21, offset: 12060}, val: "image:", ignoreCase: false, }, ¬Expr{ - pos: position{line: 272, col: 30, offset: 11371}, + pos: position{line: 286, col: 30, offset: 12069}, expr: &litMatcher{ - pos: position{line: 272, col: 31, offset: 11372}, + pos: position{line: 286, col: 31, offset: 12070}, val: ":", ignoreCase: false, }, }, &labeledExpr{ - pos: position{line: 272, col: 35, offset: 11376}, + pos: position{line: 286, col: 35, offset: 12074}, label: "path", expr: &ruleRefExpr{ - pos: position{line: 272, col: 41, offset: 11382}, + pos: position{line: 286, col: 41, offset: 12080}, name: "URL", }, }, &litMatcher{ - pos: position{line: 272, col: 46, offset: 11387}, + pos: position{line: 286, col: 46, offset: 12085}, val: "[", ignoreCase: false, }, &labeledExpr{ - pos: position{line: 272, col: 50, offset: 11391}, + pos: position{line: 286, col: 50, offset: 12089}, label: "attributes", expr: &zeroOrOneExpr{ - pos: position{line: 272, col: 62, offset: 11403}, + pos: position{line: 286, col: 62, offset: 12101}, expr: &ruleRefExpr{ - pos: position{line: 272, col: 62, offset: 11403}, + pos: position{line: 286, col: 62, offset: 12101}, name: "URL_TEXT", }, }, }, &litMatcher{ - pos: position{line: 272, col: 73, offset: 11414}, + pos: position{line: 286, col: 73, offset: 12112}, val: "]", ignoreCase: false, }, @@ -2842,57 +2947,57 @@ var g = &grammar{ }, { name: "DelimitedBlock", - pos: position{line: 279, col: 1, offset: 11752}, + pos: position{line: 293, col: 1, offset: 12450}, expr: &ruleRefExpr{ - pos: position{line: 279, col: 19, offset: 11770}, + pos: position{line: 293, col: 19, offset: 12468}, name: "FencedBlock", }, }, { name: "FencedBlock", - pos: position{line: 281, col: 1, offset: 11784}, + pos: position{line: 295, col: 1, offset: 12482}, expr: &actionExpr{ - pos: position{line: 281, col: 16, offset: 11799}, + pos: position{line: 295, col: 16, offset: 12497}, run: (*parser).callonFencedBlock1, expr: &seqExpr{ - pos: position{line: 281, col: 16, offset: 11799}, + pos: position{line: 295, col: 16, offset: 12497}, exprs: []interface{}{ &ruleRefExpr{ - pos: position{line: 281, col: 16, offset: 11799}, + pos: position{line: 295, col: 16, offset: 12497}, name: "FencedBlockDelimiter", }, &zeroOrMoreExpr{ - pos: position{line: 281, col: 37, offset: 11820}, + pos: position{line: 295, col: 37, offset: 12518}, expr: &ruleRefExpr{ - pos: position{line: 281, col: 37, offset: 11820}, + pos: position{line: 295, col: 37, offset: 12518}, name: "WS", }, }, &ruleRefExpr{ - pos: position{line: 281, col: 41, offset: 11824}, + pos: position{line: 295, col: 41, offset: 12522}, name: "NEWLINE", }, &labeledExpr{ - pos: position{line: 281, col: 49, offset: 11832}, + pos: position{line: 295, col: 49, offset: 12530}, label: "content", expr: &ruleRefExpr{ - pos: position{line: 281, col: 58, offset: 11841}, + pos: position{line: 295, col: 58, offset: 12539}, name: "FencedBlockContent", }, }, &ruleRefExpr{ - pos: position{line: 281, col: 78, offset: 11861}, + pos: position{line: 295, col: 78, offset: 12559}, name: "FencedBlockDelimiter", }, &zeroOrMoreExpr{ - pos: position{line: 281, col: 99, offset: 11882}, + pos: position{line: 295, col: 99, offset: 12580}, expr: &ruleRefExpr{ - pos: position{line: 281, col: 99, offset: 11882}, + pos: position{line: 295, col: 99, offset: 12580}, name: "WS", }, }, &ruleRefExpr{ - pos: position{line: 281, col: 103, offset: 11886}, + pos: position{line: 295, col: 103, offset: 12584}, name: "EOL", }, }, @@ -2901,33 +3006,33 @@ var g = &grammar{ }, { name: "FencedBlockDelimiter", - pos: position{line: 285, col: 1, offset: 11974}, + pos: position{line: 299, col: 1, offset: 12672}, expr: &litMatcher{ - pos: position{line: 285, col: 25, offset: 11998}, + pos: position{line: 299, col: 25, offset: 12696}, val: "```", ignoreCase: false, }, }, { name: "FencedBlockContent", - pos: position{line: 287, col: 1, offset: 12005}, + pos: position{line: 301, col: 1, offset: 12703}, expr: &labeledExpr{ - pos: position{line: 287, col: 23, offset: 12027}, + pos: position{line: 301, col: 23, offset: 12725}, label: "content", expr: &zeroOrMoreExpr{ - pos: position{line: 287, col: 31, offset: 12035}, + pos: position{line: 301, col: 31, offset: 12733}, expr: &seqExpr{ - pos: position{line: 287, col: 32, offset: 12036}, + pos: position{line: 301, col: 32, offset: 12734}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 287, col: 32, offset: 12036}, + pos: position{line: 301, col: 32, offset: 12734}, expr: &ruleRefExpr{ - pos: position{line: 287, col: 33, offset: 12037}, + pos: position{line: 301, col: 33, offset: 12735}, name: "FencedBlockDelimiter", }, }, &anyMatcher{ - line: 287, col: 54, offset: 12058, + line: 301, col: 54, offset: 12756, }, }, }, @@ -2936,20 +3041,20 @@ var g = &grammar{ }, { name: "LiteralBlock", - pos: position{line: 292, col: 1, offset: 12331}, + pos: position{line: 306, col: 1, offset: 13029}, expr: &choiceExpr{ - pos: position{line: 292, col: 17, offset: 12347}, + pos: position{line: 306, col: 17, offset: 13045}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 292, col: 17, offset: 12347}, + pos: position{line: 306, col: 17, offset: 13045}, name: "ParagraphWithSpaces", }, &ruleRefExpr{ - pos: position{line: 292, col: 39, offset: 12369}, + pos: position{line: 306, col: 39, offset: 13067}, name: "ParagraphWithLiteralBlockDelimiter", }, &ruleRefExpr{ - pos: position{line: 292, col: 76, offset: 12406}, + pos: position{line: 306, col: 76, offset: 13104}, name: "ParagraphWithLiteralAttribute", }, }, @@ -2957,41 +3062,41 @@ var g = &grammar{ }, { name: "ParagraphWithSpaces", - pos: position{line: 295, col: 1, offset: 12501}, + pos: position{line: 309, col: 1, offset: 13199}, expr: &actionExpr{ - pos: position{line: 295, col: 24, offset: 12524}, + pos: position{line: 309, col: 24, offset: 13222}, run: (*parser).callonParagraphWithSpaces1, expr: &seqExpr{ - pos: position{line: 295, col: 24, offset: 12524}, + pos: position{line: 309, col: 24, offset: 13222}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 295, col: 24, offset: 12524}, + pos: position{line: 309, col: 24, offset: 13222}, label: "spaces", expr: &oneOrMoreExpr{ - pos: position{line: 295, col: 32, offset: 12532}, + pos: position{line: 309, col: 32, offset: 13230}, expr: &ruleRefExpr{ - pos: position{line: 295, col: 32, offset: 12532}, + pos: position{line: 309, col: 32, offset: 13230}, name: "WS", }, }, }, ¬Expr{ - pos: position{line: 295, col: 37, offset: 12537}, + pos: position{line: 309, col: 37, offset: 13235}, expr: &ruleRefExpr{ - pos: position{line: 295, col: 38, offset: 12538}, + pos: position{line: 309, col: 38, offset: 13236}, name: "NEWLINE", }, }, &labeledExpr{ - pos: position{line: 295, col: 46, offset: 12546}, + pos: position{line: 309, col: 46, offset: 13244}, label: "content", expr: &ruleRefExpr{ - pos: position{line: 295, col: 55, offset: 12555}, + pos: position{line: 309, col: 55, offset: 13253}, name: "LiteralBlockContent", }, }, &ruleRefExpr{ - pos: position{line: 295, col: 76, offset: 12576}, + pos: position{line: 309, col: 76, offset: 13274}, name: "EndOfLiteralBlock", }, }, @@ -3000,36 +3105,36 @@ var g = &grammar{ }, { name: "LiteralBlockContent", - pos: position{line: 301, col: 1, offset: 12833}, + pos: position{line: 315, col: 1, offset: 13531}, expr: &actionExpr{ - pos: position{line: 301, col: 24, offset: 12856}, + pos: position{line: 315, col: 24, offset: 13554}, run: (*parser).callonLiteralBlockContent1, expr: &labeledExpr{ - pos: position{line: 301, col: 24, offset: 12856}, + pos: position{line: 315, col: 24, offset: 13554}, label: "content", expr: &oneOrMoreExpr{ - pos: position{line: 301, col: 32, offset: 12864}, + pos: position{line: 315, col: 32, offset: 13562}, expr: &seqExpr{ - pos: position{line: 301, col: 33, offset: 12865}, + pos: position{line: 315, col: 33, offset: 13563}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 301, col: 33, offset: 12865}, + pos: position{line: 315, col: 33, offset: 13563}, expr: &seqExpr{ - pos: position{line: 301, col: 35, offset: 12867}, + pos: position{line: 315, col: 35, offset: 13565}, exprs: []interface{}{ &ruleRefExpr{ - pos: position{line: 301, col: 35, offset: 12867}, + pos: position{line: 315, col: 35, offset: 13565}, name: "NEWLINE", }, &ruleRefExpr{ - pos: position{line: 301, col: 43, offset: 12875}, + pos: position{line: 315, col: 43, offset: 13573}, name: "BlankLine", }, }, }, }, &anyMatcher{ - line: 301, col: 54, offset: 12886, + line: 315, col: 54, offset: 13584, }, }, }, @@ -3039,29 +3144,29 @@ var g = &grammar{ }, { name: "EndOfLiteralBlock", - pos: position{line: 306, col: 1, offset: 12971}, + pos: position{line: 320, col: 1, offset: 13669}, expr: &choiceExpr{ - pos: position{line: 306, col: 22, offset: 12992}, + pos: position{line: 320, col: 22, offset: 13690}, alternatives: []interface{}{ &seqExpr{ - pos: position{line: 306, col: 22, offset: 12992}, + pos: position{line: 320, col: 22, offset: 13690}, exprs: []interface{}{ &ruleRefExpr{ - pos: position{line: 306, col: 22, offset: 12992}, + pos: position{line: 320, col: 22, offset: 13690}, name: "NEWLINE", }, &ruleRefExpr{ - pos: position{line: 306, col: 30, offset: 13000}, + pos: position{line: 320, col: 30, offset: 13698}, name: "BlankLine", }, }, }, &ruleRefExpr{ - pos: position{line: 306, col: 42, offset: 13012}, + pos: position{line: 320, col: 42, offset: 13710}, name: "NEWLINE", }, &ruleRefExpr{ - pos: position{line: 306, col: 52, offset: 13022}, + pos: position{line: 320, col: 52, offset: 13720}, name: "EOF", }, }, @@ -3069,63 +3174,63 @@ var g = &grammar{ }, { name: "ParagraphWithLiteralBlockDelimiter", - pos: position{line: 309, col: 1, offset: 13082}, + pos: position{line: 323, col: 1, offset: 13780}, expr: &actionExpr{ - pos: position{line: 309, col: 39, offset: 13120}, + pos: position{line: 323, col: 39, offset: 13818}, run: (*parser).callonParagraphWithLiteralBlockDelimiter1, expr: &seqExpr{ - pos: position{line: 309, col: 39, offset: 13120}, + pos: position{line: 323, col: 39, offset: 13818}, exprs: []interface{}{ &ruleRefExpr{ - pos: position{line: 309, col: 39, offset: 13120}, + pos: position{line: 323, col: 39, offset: 13818}, name: "LiteralBlockDelimiter", }, &zeroOrMoreExpr{ - pos: position{line: 309, col: 61, offset: 13142}, + pos: position{line: 323, col: 61, offset: 13840}, expr: &ruleRefExpr{ - pos: position{line: 309, col: 61, offset: 13142}, + pos: position{line: 323, col: 61, offset: 13840}, name: "WS", }, }, &ruleRefExpr{ - pos: position{line: 309, col: 65, offset: 13146}, + pos: position{line: 323, col: 65, offset: 13844}, name: "NEWLINE", }, &labeledExpr{ - pos: position{line: 309, col: 73, offset: 13154}, + pos: position{line: 323, col: 73, offset: 13852}, label: "content", expr: &zeroOrMoreExpr{ - pos: position{line: 309, col: 81, offset: 13162}, + pos: position{line: 323, col: 81, offset: 13860}, expr: &seqExpr{ - pos: position{line: 309, col: 82, offset: 13163}, + pos: position{line: 323, col: 82, offset: 13861}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 309, col: 82, offset: 13163}, + pos: position{line: 323, col: 82, offset: 13861}, expr: &ruleRefExpr{ - pos: position{line: 309, col: 83, offset: 13164}, + pos: position{line: 323, col: 83, offset: 13862}, name: "LiteralBlockDelimiter", }, }, &anyMatcher{ - line: 309, col: 105, offset: 13186, + line: 323, col: 105, offset: 13884, }, }, }, }, }, &ruleRefExpr{ - pos: position{line: 309, col: 109, offset: 13190}, + pos: position{line: 323, col: 109, offset: 13888}, name: "LiteralBlockDelimiter", }, &zeroOrMoreExpr{ - pos: position{line: 309, col: 131, offset: 13212}, + pos: position{line: 323, col: 131, offset: 13910}, expr: &ruleRefExpr{ - pos: position{line: 309, col: 131, offset: 13212}, + pos: position{line: 323, col: 131, offset: 13910}, name: "WS", }, }, &ruleRefExpr{ - pos: position{line: 309, col: 135, offset: 13216}, + pos: position{line: 323, col: 135, offset: 13914}, name: "EOL", }, }, @@ -3134,48 +3239,48 @@ var g = &grammar{ }, { name: "LiteralBlockDelimiter", - pos: position{line: 313, col: 1, offset: 13300}, + pos: position{line: 327, col: 1, offset: 13998}, expr: &litMatcher{ - pos: position{line: 313, col: 26, offset: 13325}, + pos: position{line: 327, col: 26, offset: 14023}, val: "....", ignoreCase: false, }, }, { name: "ParagraphWithLiteralAttribute", - pos: position{line: 316, col: 1, offset: 13387}, + pos: position{line: 330, col: 1, offset: 14085}, expr: &actionExpr{ - pos: position{line: 316, col: 34, offset: 13420}, + pos: position{line: 330, col: 34, offset: 14118}, run: (*parser).callonParagraphWithLiteralAttribute1, expr: &seqExpr{ - pos: position{line: 316, col: 34, offset: 13420}, + pos: position{line: 330, col: 34, offset: 14118}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 316, col: 34, offset: 13420}, + pos: position{line: 330, col: 34, offset: 14118}, val: "[literal]", ignoreCase: false, }, &zeroOrMoreExpr{ - pos: position{line: 316, col: 46, offset: 13432}, + pos: position{line: 330, col: 46, offset: 14130}, expr: &ruleRefExpr{ - pos: position{line: 316, col: 46, offset: 13432}, + pos: position{line: 330, col: 46, offset: 14130}, name: "WS", }, }, &ruleRefExpr{ - pos: position{line: 316, col: 50, offset: 13436}, + pos: position{line: 330, col: 50, offset: 14134}, name: "NEWLINE", }, &labeledExpr{ - pos: position{line: 316, col: 58, offset: 13444}, + pos: position{line: 330, col: 58, offset: 14142}, label: "content", expr: &ruleRefExpr{ - pos: position{line: 316, col: 67, offset: 13453}, + pos: position{line: 330, col: 67, offset: 14151}, name: "LiteralBlockContent", }, }, &ruleRefExpr{ - pos: position{line: 316, col: 88, offset: 13474}, + pos: position{line: 330, col: 88, offset: 14172}, name: "EndOfLiteralBlock", }, }, @@ -3184,23 +3289,23 @@ var g = &grammar{ }, { name: "ElementAttribute", - pos: position{line: 323, col: 1, offset: 13686}, + pos: position{line: 337, col: 1, offset: 14384}, expr: &labeledExpr{ - pos: position{line: 323, col: 21, offset: 13706}, + pos: position{line: 337, col: 21, offset: 14404}, label: "meta", expr: &choiceExpr{ - pos: position{line: 323, col: 27, offset: 13712}, + pos: position{line: 337, col: 27, offset: 14410}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 323, col: 27, offset: 13712}, + pos: position{line: 337, col: 27, offset: 14410}, name: "ElementLink", }, &ruleRefExpr{ - pos: position{line: 323, col: 41, offset: 13726}, + pos: position{line: 337, col: 41, offset: 14424}, name: "ElementID", }, &ruleRefExpr{ - pos: position{line: 323, col: 53, offset: 13738}, + pos: position{line: 337, col: 53, offset: 14436}, name: "ElementTitle", }, }, @@ -3209,71 +3314,71 @@ var g = &grammar{ }, { name: "ElementLink", - pos: position{line: 326, col: 1, offset: 13809}, + pos: position{line: 340, col: 1, offset: 14507}, expr: &actionExpr{ - pos: position{line: 326, col: 16, offset: 13824}, + pos: position{line: 340, col: 16, offset: 14522}, run: (*parser).callonElementLink1, expr: &seqExpr{ - pos: position{line: 326, col: 16, offset: 13824}, + pos: position{line: 340, col: 16, offset: 14522}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 326, col: 16, offset: 13824}, + pos: position{line: 340, col: 16, offset: 14522}, val: "[", ignoreCase: false, }, &zeroOrMoreExpr{ - pos: position{line: 326, col: 20, offset: 13828}, + pos: position{line: 340, col: 20, offset: 14526}, expr: &ruleRefExpr{ - pos: position{line: 326, col: 20, offset: 13828}, + pos: position{line: 340, col: 20, offset: 14526}, name: "WS", }, }, &litMatcher{ - pos: position{line: 326, col: 24, offset: 13832}, + pos: position{line: 340, col: 24, offset: 14530}, val: "link", ignoreCase: false, }, &zeroOrMoreExpr{ - pos: position{line: 326, col: 31, offset: 13839}, + pos: position{line: 340, col: 31, offset: 14537}, expr: &ruleRefExpr{ - pos: position{line: 326, col: 31, offset: 13839}, + pos: position{line: 340, col: 31, offset: 14537}, name: "WS", }, }, &litMatcher{ - pos: position{line: 326, col: 35, offset: 13843}, + pos: position{line: 340, col: 35, offset: 14541}, val: "=", ignoreCase: false, }, &zeroOrMoreExpr{ - pos: position{line: 326, col: 39, offset: 13847}, + pos: position{line: 340, col: 39, offset: 14545}, expr: &ruleRefExpr{ - pos: position{line: 326, col: 39, offset: 13847}, + pos: position{line: 340, col: 39, offset: 14545}, name: "WS", }, }, &labeledExpr{ - pos: position{line: 326, col: 43, offset: 13851}, + pos: position{line: 340, col: 43, offset: 14549}, label: "path", expr: &ruleRefExpr{ - pos: position{line: 326, col: 48, offset: 13856}, + pos: position{line: 340, col: 48, offset: 14554}, name: "URL", }, }, &zeroOrMoreExpr{ - pos: position{line: 326, col: 52, offset: 13860}, + pos: position{line: 340, col: 52, offset: 14558}, expr: &ruleRefExpr{ - pos: position{line: 326, col: 52, offset: 13860}, + pos: position{line: 340, col: 52, offset: 14558}, name: "WS", }, }, &litMatcher{ - pos: position{line: 326, col: 56, offset: 13864}, + pos: position{line: 340, col: 56, offset: 14562}, val: "]", ignoreCase: false, }, &ruleRefExpr{ - pos: position{line: 326, col: 60, offset: 13868}, + pos: position{line: 340, col: 60, offset: 14566}, name: "EOL", }, }, @@ -3282,52 +3387,52 @@ var g = &grammar{ }, { name: "ElementID", - pos: position{line: 331, col: 1, offset: 13978}, + pos: position{line: 345, col: 1, offset: 14676}, expr: &actionExpr{ - pos: position{line: 331, col: 14, offset: 13991}, + pos: position{line: 345, col: 14, offset: 14689}, run: (*parser).callonElementID1, expr: &seqExpr{ - pos: position{line: 331, col: 14, offset: 13991}, + pos: position{line: 345, col: 14, offset: 14689}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 331, col: 14, offset: 13991}, + pos: position{line: 345, col: 14, offset: 14689}, val: "[", ignoreCase: false, }, &zeroOrMoreExpr{ - pos: position{line: 331, col: 18, offset: 13995}, + pos: position{line: 345, col: 18, offset: 14693}, expr: &ruleRefExpr{ - pos: position{line: 331, col: 18, offset: 13995}, + pos: position{line: 345, col: 18, offset: 14693}, name: "WS", }, }, &litMatcher{ - pos: position{line: 331, col: 22, offset: 13999}, + pos: position{line: 345, col: 22, offset: 14697}, val: "#", ignoreCase: false, }, &labeledExpr{ - pos: position{line: 331, col: 26, offset: 14003}, + pos: position{line: 345, col: 26, offset: 14701}, label: "id", expr: &ruleRefExpr{ - pos: position{line: 331, col: 30, offset: 14007}, + pos: position{line: 345, col: 30, offset: 14705}, name: "ID", }, }, &zeroOrMoreExpr{ - pos: position{line: 331, col: 34, offset: 14011}, + pos: position{line: 345, col: 34, offset: 14709}, expr: &ruleRefExpr{ - pos: position{line: 331, col: 34, offset: 14011}, + pos: position{line: 345, col: 34, offset: 14709}, name: "WS", }, }, &litMatcher{ - pos: position{line: 331, col: 38, offset: 14015}, + pos: position{line: 345, col: 38, offset: 14713}, val: "]", ignoreCase: false, }, &ruleRefExpr{ - pos: position{line: 331, col: 42, offset: 14019}, + pos: position{line: 345, col: 42, offset: 14717}, name: "EOL", }, }, @@ -3336,57 +3441,57 @@ var g = &grammar{ }, { name: "ElementTitle", - pos: position{line: 337, col: 1, offset: 14213}, + pos: position{line: 351, col: 1, offset: 14911}, expr: &actionExpr{ - pos: position{line: 337, col: 17, offset: 14229}, + pos: position{line: 351, col: 17, offset: 14927}, run: (*parser).callonElementTitle1, expr: &seqExpr{ - pos: position{line: 337, col: 17, offset: 14229}, + pos: position{line: 351, col: 17, offset: 14927}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 337, col: 17, offset: 14229}, + pos: position{line: 351, col: 17, offset: 14927}, val: ".", ignoreCase: false, }, ¬Expr{ - pos: position{line: 337, col: 21, offset: 14233}, + pos: position{line: 351, col: 21, offset: 14931}, expr: &litMatcher{ - pos: position{line: 337, col: 22, offset: 14234}, + pos: position{line: 351, col: 22, offset: 14932}, val: ".", ignoreCase: false, }, }, ¬Expr{ - pos: position{line: 337, col: 26, offset: 14238}, + pos: position{line: 351, col: 26, offset: 14936}, expr: &ruleRefExpr{ - pos: position{line: 337, col: 27, offset: 14239}, + pos: position{line: 351, col: 27, offset: 14937}, name: "WS", }, }, &labeledExpr{ - pos: position{line: 337, col: 30, offset: 14242}, + pos: position{line: 351, col: 30, offset: 14940}, label: "title", expr: &oneOrMoreExpr{ - pos: position{line: 337, col: 36, offset: 14248}, + pos: position{line: 351, col: 36, offset: 14946}, expr: &seqExpr{ - pos: position{line: 337, col: 37, offset: 14249}, + pos: position{line: 351, col: 37, offset: 14947}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 337, col: 37, offset: 14249}, + pos: position{line: 351, col: 37, offset: 14947}, expr: &ruleRefExpr{ - pos: position{line: 337, col: 38, offset: 14250}, + pos: position{line: 351, col: 38, offset: 14948}, name: "NEWLINE", }, }, &anyMatcher{ - line: 337, col: 46, offset: 14258, + line: 351, col: 46, offset: 14956, }, }, }, }, }, &ruleRefExpr{ - pos: position{line: 337, col: 50, offset: 14262}, + pos: position{line: 351, col: 50, offset: 14960}, name: "EOL", }, }, @@ -3395,31 +3500,31 @@ var g = &grammar{ }, { name: "Word", - pos: position{line: 344, col: 1, offset: 14433}, + pos: position{line: 358, col: 1, offset: 15131}, expr: &actionExpr{ - pos: position{line: 344, col: 9, offset: 14441}, + pos: position{line: 358, col: 9, offset: 15139}, run: (*parser).callonWord1, expr: &oneOrMoreExpr{ - pos: position{line: 344, col: 9, offset: 14441}, + pos: position{line: 358, col: 9, offset: 15139}, expr: &seqExpr{ - pos: position{line: 344, col: 10, offset: 14442}, + pos: position{line: 358, col: 10, offset: 15140}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 344, col: 10, offset: 14442}, + pos: position{line: 358, col: 10, offset: 15140}, expr: &ruleRefExpr{ - pos: position{line: 344, col: 11, offset: 14443}, + pos: position{line: 358, col: 11, offset: 15141}, name: "NEWLINE", }, }, ¬Expr{ - pos: position{line: 344, col: 19, offset: 14451}, + pos: position{line: 358, col: 19, offset: 15149}, expr: &ruleRefExpr{ - pos: position{line: 344, col: 20, offset: 14452}, + pos: position{line: 358, col: 20, offset: 15150}, name: "WS", }, }, &anyMatcher{ - line: 344, col: 23, offset: 14455, + line: 358, col: 23, offset: 15153, }, }, }, @@ -3428,29 +3533,29 @@ var g = &grammar{ }, { name: "BlankLine", - pos: position{line: 348, col: 1, offset: 14495}, + pos: position{line: 362, col: 1, offset: 15193}, expr: &actionExpr{ - pos: position{line: 348, col: 14, offset: 14508}, + pos: position{line: 362, col: 14, offset: 15206}, run: (*parser).callonBlankLine1, expr: &seqExpr{ - pos: position{line: 348, col: 14, offset: 14508}, + pos: position{line: 362, col: 14, offset: 15206}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 348, col: 14, offset: 14508}, + pos: position{line: 362, col: 14, offset: 15206}, expr: &ruleRefExpr{ - pos: position{line: 348, col: 15, offset: 14509}, + pos: position{line: 362, col: 15, offset: 15207}, name: "EOF", }, }, &zeroOrMoreExpr{ - pos: position{line: 348, col: 19, offset: 14513}, + pos: position{line: 362, col: 19, offset: 15211}, expr: &ruleRefExpr{ - pos: position{line: 348, col: 19, offset: 14513}, + pos: position{line: 362, col: 19, offset: 15211}, name: "WS", }, }, &ruleRefExpr{ - pos: position{line: 348, col: 23, offset: 14517}, + pos: position{line: 362, col: 23, offset: 15215}, name: "EOL", }, }, @@ -3459,47 +3564,47 @@ var g = &grammar{ }, { name: "URL", - pos: position{line: 352, col: 1, offset: 14558}, + pos: position{line: 366, col: 1, offset: 15256}, expr: &actionExpr{ - pos: position{line: 352, col: 8, offset: 14565}, + pos: position{line: 366, col: 8, offset: 15263}, run: (*parser).callonURL1, expr: &oneOrMoreExpr{ - pos: position{line: 352, col: 8, offset: 14565}, + pos: position{line: 366, col: 8, offset: 15263}, expr: &seqExpr{ - pos: position{line: 352, col: 9, offset: 14566}, + pos: position{line: 366, col: 9, offset: 15264}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 352, col: 9, offset: 14566}, + pos: position{line: 366, col: 9, offset: 15264}, expr: &ruleRefExpr{ - pos: position{line: 352, col: 10, offset: 14567}, + pos: position{line: 366, col: 10, offset: 15265}, name: "NEWLINE", }, }, ¬Expr{ - pos: position{line: 352, col: 18, offset: 14575}, + pos: position{line: 366, col: 18, offset: 15273}, expr: &ruleRefExpr{ - pos: position{line: 352, col: 19, offset: 14576}, + pos: position{line: 366, col: 19, offset: 15274}, name: "WS", }, }, ¬Expr{ - pos: position{line: 352, col: 22, offset: 14579}, + pos: position{line: 366, col: 22, offset: 15277}, expr: &litMatcher{ - pos: position{line: 352, col: 23, offset: 14580}, + pos: position{line: 366, col: 23, offset: 15278}, val: "[", ignoreCase: false, }, }, ¬Expr{ - pos: position{line: 352, col: 27, offset: 14584}, + pos: position{line: 366, col: 27, offset: 15282}, expr: &litMatcher{ - pos: position{line: 352, col: 28, offset: 14585}, + pos: position{line: 366, col: 28, offset: 15283}, val: "]", ignoreCase: false, }, }, &anyMatcher{ - line: 352, col: 32, offset: 14589, + line: 366, col: 32, offset: 15287, }, }, }, @@ -3508,47 +3613,47 @@ var g = &grammar{ }, { name: "ID", - pos: position{line: 356, col: 1, offset: 14629}, + pos: position{line: 370, col: 1, offset: 15327}, expr: &actionExpr{ - pos: position{line: 356, col: 7, offset: 14635}, + pos: position{line: 370, col: 7, offset: 15333}, run: (*parser).callonID1, expr: &oneOrMoreExpr{ - pos: position{line: 356, col: 7, offset: 14635}, + pos: position{line: 370, col: 7, offset: 15333}, expr: &seqExpr{ - pos: position{line: 356, col: 8, offset: 14636}, + pos: position{line: 370, col: 8, offset: 15334}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 356, col: 8, offset: 14636}, + pos: position{line: 370, col: 8, offset: 15334}, expr: &ruleRefExpr{ - pos: position{line: 356, col: 9, offset: 14637}, + pos: position{line: 370, col: 9, offset: 15335}, name: "NEWLINE", }, }, ¬Expr{ - pos: position{line: 356, col: 17, offset: 14645}, + pos: position{line: 370, col: 17, offset: 15343}, expr: &ruleRefExpr{ - pos: position{line: 356, col: 18, offset: 14646}, + pos: position{line: 370, col: 18, offset: 15344}, name: "WS", }, }, ¬Expr{ - pos: position{line: 356, col: 21, offset: 14649}, + pos: position{line: 370, col: 21, offset: 15347}, expr: &litMatcher{ - pos: position{line: 356, col: 22, offset: 14650}, + pos: position{line: 370, col: 22, offset: 15348}, val: "[", ignoreCase: false, }, }, ¬Expr{ - pos: position{line: 356, col: 26, offset: 14654}, + pos: position{line: 370, col: 26, offset: 15352}, expr: &litMatcher{ - pos: position{line: 356, col: 27, offset: 14655}, + pos: position{line: 370, col: 27, offset: 15353}, val: "]", ignoreCase: false, }, }, &anyMatcher{ - line: 356, col: 31, offset: 14659, + line: 370, col: 31, offset: 15357, }, }, }, @@ -3557,40 +3662,40 @@ var g = &grammar{ }, { name: "URL_TEXT", - pos: position{line: 360, col: 1, offset: 14699}, + pos: position{line: 374, col: 1, offset: 15397}, expr: &actionExpr{ - pos: position{line: 360, col: 13, offset: 14711}, + pos: position{line: 374, col: 13, offset: 15409}, run: (*parser).callonURL_TEXT1, expr: &oneOrMoreExpr{ - pos: position{line: 360, col: 13, offset: 14711}, + pos: position{line: 374, col: 13, offset: 15409}, expr: &seqExpr{ - pos: position{line: 360, col: 14, offset: 14712}, + pos: position{line: 374, col: 14, offset: 15410}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 360, col: 14, offset: 14712}, + pos: position{line: 374, col: 14, offset: 15410}, expr: &ruleRefExpr{ - pos: position{line: 360, col: 15, offset: 14713}, + pos: position{line: 374, col: 15, offset: 15411}, name: "NEWLINE", }, }, ¬Expr{ - pos: position{line: 360, col: 23, offset: 14721}, + pos: position{line: 374, col: 23, offset: 15419}, expr: &litMatcher{ - pos: position{line: 360, col: 24, offset: 14722}, + pos: position{line: 374, col: 24, offset: 15420}, val: "[", ignoreCase: false, }, }, ¬Expr{ - pos: position{line: 360, col: 28, offset: 14726}, + pos: position{line: 374, col: 28, offset: 15424}, expr: &litMatcher{ - pos: position{line: 360, col: 29, offset: 14727}, + pos: position{line: 374, col: 29, offset: 15425}, val: "]", ignoreCase: false, }, }, &anyMatcher{ - line: 360, col: 33, offset: 14731, + line: 374, col: 33, offset: 15429, }, }, }, @@ -3599,32 +3704,32 @@ var g = &grammar{ }, { name: "URL_SCHEME", - pos: position{line: 364, col: 1, offset: 14771}, + pos: position{line: 378, col: 1, offset: 15469}, expr: &choiceExpr{ - pos: position{line: 364, col: 15, offset: 14785}, + pos: position{line: 378, col: 15, offset: 15483}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 364, col: 15, offset: 14785}, + pos: position{line: 378, col: 15, offset: 15483}, val: "http://", ignoreCase: false, }, &litMatcher{ - pos: position{line: 364, col: 27, offset: 14797}, + pos: position{line: 378, col: 27, offset: 15495}, val: "https://", ignoreCase: false, }, &litMatcher{ - pos: position{line: 364, col: 40, offset: 14810}, + pos: position{line: 378, col: 40, offset: 15508}, val: "ftp://", ignoreCase: false, }, &litMatcher{ - pos: position{line: 364, col: 51, offset: 14821}, + pos: position{line: 378, col: 51, offset: 15519}, val: "irc://", ignoreCase: false, }, &litMatcher{ - pos: position{line: 364, col: 62, offset: 14832}, + pos: position{line: 378, col: 62, offset: 15530}, val: "mailto:", ignoreCase: false, }, @@ -3633,9 +3738,9 @@ var g = &grammar{ }, { name: "DIGIT", - pos: position{line: 366, col: 1, offset: 14843}, + pos: position{line: 380, col: 1, offset: 15541}, expr: &charClassMatcher{ - pos: position{line: 366, col: 13, offset: 14855}, + pos: position{line: 380, col: 13, offset: 15553}, val: "[0-9]", ranges: []rune{'0', '9'}, ignoreCase: false, @@ -3644,22 +3749,22 @@ var g = &grammar{ }, { name: "NEWLINE", - pos: position{line: 368, col: 1, offset: 14862}, + pos: position{line: 382, col: 1, offset: 15560}, expr: &choiceExpr{ - pos: position{line: 368, col: 13, offset: 14874}, + pos: position{line: 382, col: 13, offset: 15572}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 368, col: 13, offset: 14874}, + pos: position{line: 382, col: 13, offset: 15572}, val: "\r\n", ignoreCase: false, }, &litMatcher{ - pos: position{line: 368, col: 22, offset: 14883}, + pos: position{line: 382, col: 22, offset: 15581}, val: "\r", ignoreCase: false, }, &litMatcher{ - pos: position{line: 368, col: 29, offset: 14890}, + pos: position{line: 382, col: 29, offset: 15588}, val: "\n", ignoreCase: false, }, @@ -3668,20 +3773,20 @@ var g = &grammar{ }, { name: "WS", - pos: position{line: 370, col: 1, offset: 14896}, + pos: position{line: 384, col: 1, offset: 15594}, expr: &choiceExpr{ - pos: position{line: 370, col: 13, offset: 14908}, + pos: position{line: 384, col: 13, offset: 15606}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 370, col: 13, offset: 14908}, + pos: position{line: 384, col: 13, offset: 15606}, val: " ", ignoreCase: false, }, &actionExpr{ - pos: position{line: 370, col: 19, offset: 14914}, + pos: position{line: 384, col: 19, offset: 15612}, run: (*parser).callonWS3, expr: &litMatcher{ - pos: position{line: 370, col: 19, offset: 14914}, + pos: position{line: 384, col: 19, offset: 15612}, val: "\t", ignoreCase: false, }, @@ -3691,26 +3796,26 @@ var g = &grammar{ }, { name: "EOF", - pos: position{line: 374, col: 1, offset: 14959}, + pos: position{line: 388, col: 1, offset: 15657}, expr: ¬Expr{ - pos: position{line: 374, col: 13, offset: 14971}, + pos: position{line: 388, col: 13, offset: 15669}, expr: &anyMatcher{ - line: 374, col: 14, offset: 14972, + line: 388, col: 14, offset: 15670, }, }, }, { name: "EOL", - pos: position{line: 376, col: 1, offset: 14975}, + pos: position{line: 390, col: 1, offset: 15673}, expr: &choiceExpr{ - pos: position{line: 376, col: 13, offset: 14987}, + pos: position{line: 390, col: 13, offset: 15685}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 376, col: 13, offset: 14987}, + pos: position{line: 390, col: 13, offset: 15685}, name: "NEWLINE", }, &ruleRefExpr{ - pos: position{line: 376, col: 23, offset: 14997}, + pos: position{line: 390, col: 23, offset: 15695}, name: "EOF", }, }, @@ -4064,7 +4169,7 @@ func (p *parser) callonParagraph1() (interface{}, error) { } func (c *current) onInlineContent1(elements interface{}) (interface{}, error) { - // needs an 'EOL' but does not consume it here. + // needs an "EOL" but does not consume it here. return types.NewInlineContent(c.text, elements.([]interface{})) } @@ -4074,34 +4179,64 @@ func (p *parser) callonInlineContent1() (interface{}, error) { return p.cur.onInlineContent1(stack["elements"]) } -func (c *current) onBoldText1(content interface{}) (interface{}, error) { +func (c *current) onBoldTextSimplePunctuation1(content interface{}) (interface{}, error) { return types.NewQuotedText(types.Bold, content.([]interface{})) } -func (p *parser) callonBoldText1() (interface{}, error) { +func (p *parser) callonBoldTextSimplePunctuation1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onBoldText1(stack["content"]) + return p.cur.onBoldTextSimplePunctuation1(stack["content"]) } -func (c *current) onItalicText1(content interface{}) (interface{}, error) { +func (c *current) onBoldTextDoublePunctuation1(content interface{}) (interface{}, error) { + return types.NewQuotedText(types.Bold, content.([]interface{})) +} + +func (p *parser) callonBoldTextDoublePunctuation1() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onBoldTextDoublePunctuation1(stack["content"]) +} + +func (c *current) onItalicTextSimplePunctuation1(content interface{}) (interface{}, error) { return types.NewQuotedText(types.Italic, content.([]interface{})) } -func (p *parser) callonItalicText1() (interface{}, error) { +func (p *parser) callonItalicTextSimplePunctuation1() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onItalicTextSimplePunctuation1(stack["content"]) +} + +func (c *current) onItalicTextDoublePunctuation1(content interface{}) (interface{}, error) { + return types.NewQuotedText(types.Italic, content.([]interface{})) +} + +func (p *parser) callonItalicTextDoublePunctuation1() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onItalicTextDoublePunctuation1(stack["content"]) +} + +func (c *current) onMonospaceTextSimplePunctuation1(content interface{}) (interface{}, error) { + return types.NewQuotedText(types.Monospace, content.([]interface{})) +} + +func (p *parser) callonMonospaceTextSimplePunctuation1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onItalicText1(stack["content"]) + return p.cur.onMonospaceTextSimplePunctuation1(stack["content"]) } -func (c *current) onMonospaceText1(content interface{}) (interface{}, error) { +func (c *current) onMonospaceTextDoublePunctuation1(content interface{}) (interface{}, error) { return types.NewQuotedText(types.Monospace, content.([]interface{})) } -func (p *parser) callonMonospaceText1() (interface{}, error) { +func (p *parser) callonMonospaceTextDoublePunctuation1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onMonospaceText1(stack["content"]) + return p.cur.onMonospaceTextDoublePunctuation1(stack["content"]) } func (c *current) onExternalLink1(url, text interface{}) (interface{}, error) { diff --git a/parser/quoted_text_test.go b/parser/quoted_text_test.go index 483d7e15..e1010e16 100644 --- a/parser/quoted_text_test.go +++ b/parser/quoted_text_test.go @@ -8,7 +8,7 @@ import ( var _ = Describe("Quoted Texts", func() { - Context("Quoted text alone", func() { + Context("Quoted text with single punctuation", func() { It("bold text of 1 word", func() { actualContent := "*hello*" @@ -125,6 +125,84 @@ var _ = Describe("Quoted Texts", func() { }) }) + Context("Quoted text with double punctuation", func() { + + It("bold text of 1 word", func() { + actualContent := "**hello**" + expectedResult := &types.QuotedText{ + Kind: types.Bold, + Elements: []types.InlineElement{ + &types.StringElement{Content: "hello"}, + }, + } + verify(GinkgoT(), expectedResult, actualContent, parser.Entrypoint("QuotedText")) + }) + + It("italic text with3 words", func() { + actualContent := "__some italic content__" + expectedResult := &types.QuotedText{ + Kind: types.Italic, + Elements: []types.InlineElement{ + &types.StringElement{Content: "some italic content"}, + }, + } + verify(GinkgoT(), expectedResult, actualContent, parser.Entrypoint("QuotedText")) + }) + + It("monospace text with3 words", func() { + actualContent := "``some monospace content``" + expectedResult := &types.QuotedText{ + Kind: types.Monospace, + Elements: []types.InlineElement{ + &types.StringElement{Content: "some monospace content"}, + }, + } + verify(GinkgoT(), expectedResult, actualContent, parser.Entrypoint("QuotedText")) + }) + + It("bold text within italic text", func() { + actualContent := "__some *bold* content__" + expectedResult := &types.QuotedText{ + Kind: types.Italic, + Elements: []types.InlineElement{ + &types.StringElement{Content: "some "}, + &types.QuotedText{ + Kind: types.Bold, + Elements: []types.InlineElement{ + &types.StringElement{Content: "bold"}, + }, + }, + &types.StringElement{Content: " content"}, + }, + } + verify(GinkgoT(), expectedResult, actualContent, parser.Entrypoint("QuotedText")) + }) + + It("monospace text within bold text within italic quote", func() { + actualContent := "**some _italic and ``monospaced content``_**" + expectedResult := &types.QuotedText{ + Kind: types.Bold, + Elements: []types.InlineElement{ + &types.StringElement{Content: "some "}, + &types.QuotedText{ + Kind: types.Italic, + Elements: []types.InlineElement{ + &types.StringElement{Content: "italic and "}, + &types.QuotedText{ + Kind: types.Monospace, + Elements: []types.InlineElement{ + &types.StringElement{Content: "monospaced content"}, + }, + }, + }, + }, + }, + } + verify(GinkgoT(), expectedResult, actualContent, parser.Entrypoint("QuotedText")) + }) + + }) + Context("Quoted text inline", func() { It("inline with bold text", func() {