diff --git a/spip2md/spip.lark b/spip2md/spip.lark index 1e9ff31..b76f8d5 100644 --- a/spip2md/spip.lark +++ b/spip2md/spip.lark @@ -6,7 +6,7 @@ start: _N* block ( _N+ block )* _N* | list | table | _block_tag - | paragraph{TEXT} + | paragraph{PARAGRAPH_TEXT, TEXT} HORIZONTAL_RULE: /- *- *- *- *[\- ]*/ @@ -40,7 +40,7 @@ orphan_block_tag: _ORPHAN_TAG_ANGLE "/"? TAG_NAME ( _OPTION_SEP TAG_OPTION )* "> _PAIR_TAG_ANGLE: /<(?=([0-9A-Za-z_:|,=\/\-\. ]+)>\r?\n[\s\S]+<\/\1>)/ _ORPHAN_TAG_ANGLE: /<(?=([0-9A-Za-z_:|,=\/\-\. ])+>\r?\n)(?![\s\S]+\<\/\1\>)/ -paragraph{text}: _inline{PARAGRAPH_TEXT} _N? ( _inline{text} _N? )* +paragraph{begin, text}: _inline{begin} _N? ( _inline{text} _N? )* _inline{text}: _inline_tag | _link @@ -51,7 +51,7 @@ _inline{text}: _inline_tag _inline_tag: pair_inline_tag | orphan_inline_tag -pair_inline_tag: _PAIR_INLINE_TAG_ANGLE TAG_NAME ( _OPTION_SEP TAG_OPTION )* ">" _N? paragraph{TEXT} ( "" | _N ) -> tag +pair_inline_tag: _PAIR_INLINE_TAG_ANGLE TAG_NAME ( _OPTION_SEP TAG_OPTION )* ">" _N? paragraph{TEXT, TEXT} ( "" | _N ) -> tag orphan_inline_tag: _INLINE_TAG_ANGLE TAG_NAME ( _OPTION_SEP TAG_OPTION )* ">" -> orphan_tag _PAIR_INLINE_TAG_ANGLE: /<(?!\/|img|emb|doc)(?=[0-9A-Za-z_:,=\/\.\|\- ]*>)/i