support for tags (mostly custom HTML & images)
This commit is contained in:
parent
a191e16eb3
commit
d30e8d07ee
@ -6,6 +6,7 @@ start: _N* block ( _N+ block )+ _N*
|
|||||||
| heading
|
| heading
|
||||||
| list
|
| list
|
||||||
| table
|
| table
|
||||||
|
| orphan_tag
|
||||||
| SEPARATOR -> hr
|
| SEPARATOR -> hr
|
||||||
|
|
||||||
list: unordered_list
|
list: unordered_list
|
||||||
@ -27,6 +28,8 @@ _inline_format: TEXT
|
|||||||
| italic
|
| italic
|
||||||
| bold
|
| bold
|
||||||
| link
|
| link
|
||||||
|
| orphan_tag
|
||||||
|
| tag
|
||||||
|
|
||||||
bold: _O_CURLY_2 ( TEXT | link | nested_italic )+ _C_CURLY_2 -> strong
|
bold: _O_CURLY_2 ( TEXT | link | nested_italic )+ _C_CURLY_2 -> strong
|
||||||
italic: _O_CURLY ( TEXT | link | nested_bold )+ _C_CURLY -> em
|
italic: _O_CURLY ( TEXT | link | nested_bold )+ _C_CURLY -> em
|
||||||
@ -41,6 +44,13 @@ footnote: _O_SQUARE_2 HREF _C_SQUARE_2 -> footnote
|
|||||||
wikipedia_link: _O_SQUARE_INTERO HREF _C_SQUARE -> a_wikipedia
|
wikipedia_link: _O_SQUARE_INTERO HREF _C_SQUARE -> a_wikipedia
|
||||||
a: _LINK_OPENING LINK_TEXT _ARROW HREF _C_SQUARE -> a
|
a: _LINK_OPENING LINK_TEXT _ARROW HREF _C_SQUARE -> a
|
||||||
|
|
||||||
|
tag: closing_tag
|
||||||
|
| opening_tag
|
||||||
|
|
||||||
|
orphan_tag: _ORPHAN_OPENING TEXT ( _PIPE TEXT )? _C_ANGLE -> orphan_tag
|
||||||
|
closing_tag: _O_ANGLE _SLASH TEXT ( _PIPE TEXT )? _C_ANGLE -> closing_tag
|
||||||
|
opening_tag: _O_ANGLE TEXT ( _PIPE TEXT )? _C_ANGLE -> opening_tag
|
||||||
|
|
||||||
// Terminals
|
// Terminals
|
||||||
/// Windows or Unix line breaks
|
/// Windows or Unix line breaks
|
||||||
_N: /\r?\n/
|
_N: /\r?\n/
|
||||||
@ -49,6 +59,11 @@ _N: /\r?\n/
|
|||||||
_HYPHEN_STAR: "-*"
|
_HYPHEN_STAR: "-*"
|
||||||
_HYPHEN_HASH: "-#"
|
_HYPHEN_HASH: "-#"
|
||||||
_PIPE: "|"
|
_PIPE: "|"
|
||||||
|
_SLASH: "/"
|
||||||
|
_O_ANGLE: "<"
|
||||||
|
_C_ANGLE: ">"
|
||||||
|
/// Opening angle bracket followed by text and not followed by a closing tag
|
||||||
|
_ORPHAN_OPENING: /<(?=([^>\/]+?)>)(?!.*<\/\1>)/
|
||||||
|
|
||||||
/// Markup
|
/// Markup
|
||||||
_O_CURLY_3: "{{{"
|
_O_CURLY_3: "{{{"
|
||||||
@ -74,7 +89,7 @@ SEPARATOR: "----" "-"*
|
|||||||
// - Don’t contains line breaks
|
// - Don’t contains line breaks
|
||||||
// - Don’t contains any markup element…
|
// - Don’t 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\|\{\}\[\]\<\>]+/
|
||||||
| /\[(?!.*->.*\])/
|
| /\[(?!.*->.*\])/
|
||||||
| /\]/
|
| /\]/
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user