don’t use inner text as text is now more strict anyway

This commit is contained in:
Guilhem Fauré 2023-04-27 15:16:30 +02:00
parent 87e9a2257e
commit cb36324e9a

View File

@ -19,7 +19,7 @@ table: ( row _N )+ -> table
row: ( _PIPE cell )+ _PIPE -> tr row: ( _PIPE cell )+ _PIPE -> tr
cell: _inline_format -> td cell: _inline_format -> td
heading: _O_CURLY_3 ( INNER_TEXT | link | nested_italic | nested_bold ) _C_CURLY_3 -> h2 heading: _O_CURLY_3 ( TEXT | link | nested_italic | nested_bold ) _C_CURLY_3 -> h2
paragraph: ( _inline_format _N? )+ -> p paragraph: ( _inline_format _N? )+ -> p
@ -28,10 +28,10 @@ _inline_format: TEXT
| bold | bold
| link | link
bold: _O_CURLY_2 ( INNER_TEXT | link | nested_italic )+ _C_CURLY_2 -> strong bold: _O_CURLY_2 ( TEXT | link | nested_italic )+ _C_CURLY_2 -> strong
italic: _O_CURLY ( INNER_TEXT | link | nested_bold )+ _C_CURLY -> em italic: _O_CURLY ( TEXT | link | nested_bold )+ _C_CURLY -> em
nested_bold: TEXT+ _O_CURLY_2 ( INNER_TEXT | link )+ _C_CURLY_2 -> strong nested_bold: TEXT+ _O_CURLY_2 ( TEXT | link )+ _C_CURLY_2 -> strong
nested_italic: TEXT+ _O_CURLY ( INNER_TEXT | link )+ _C_CURLY -> em nested_italic: TEXT+ _O_CURLY ( TEXT | link )+ _C_CURLY -> em
?link: footnote ?link: footnote
| wikipedia_link | wikipedia_link
@ -72,22 +72,25 @@ SEPARATOR: "----" "-"*
/// Text /// Text
// - Dont contains line breaks // - Dont contains line breaks
// - Dont contains any opening markup elements // - Dont contains any markup element…
// - EXCEPTED when they are used as in regular text // - EXCEPTED when they are used as in regular text
TEXT: /[^\r\n\{\[\<]+/ TEXT: /[^\r\n\{\}\[\]\<\>]+/
| /\[(?!.*->.*\])/ | /\[(?!.*->.*\])/
| /\]/
/// Inner text : /// Inner text :
// - Dont contains line breaks // - Dont contains line breaks
// - Dont contains markup closing right curly braces // - Dont contains markup closing right curly braces
INNER_TEXT: /[^\r\n\}]+/ // INNER_TEXT: /[^\r\n\}]+/
/// Link href : /// Link href :
// - Dont contains line breaks // - Dont contains line breaks
// - Dont contains markup closing right square brackets // - Dont contains markup closing right square brackets
HREF: /[^\r\n\]]+/ // HREF: /[^\r\n\]]+/
HREF: TEXT
/// Link text : /// Link text :
// - Dont contains line breaks // - Dont contains line breaks
// - Dont contains an opening or closing square bracket
// - Dont contains an hyphen angle bracket arrow ( -> ) // - Dont contains an hyphen angle bracket arrow ( -> )
LINK_TEXT: /[^\r\n\[\]]+(?=->)/ LINK_TEXT: /[^\r\n\[\]]+(?=->)/