From 64a0deac934c4cf38a38dc77973ab681459c5c78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guilhem=20Faur=C3=A9?= Date: Wed, 3 May 2023 16:32:36 +0200 Subject: [PATCH] footnotes & wikilinks OK --- spip2md/spip.lark | 6 ++++-- test/0.spip | 3 +++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/spip2md/spip.lark b/spip2md/spip.lark index 0236416..4483dd3 100644 --- a/spip2md/spip.lark +++ b/spip2md/spip.lark @@ -61,12 +61,13 @@ _link: footnote | wikilink | anchor -footnote: _FOOT HREF "]]" +footnote: _FOOT FOOTNOTE_CONTENT "]]" wikilink: _WIKI HREF "]" anchor: _A A_TEXT "->" HREF "]" _FOOT: /\[\[/ _WIKI: /\[\?/ _A: /\[(?=[^\[\n\r]+->)/ +FOOTNOTE_CONTENT: /[0-9A-Za-z_:\/\-\.\ ]+/ HREF: _PURE_TEXT A_TEXT: /[^\r\n\{]+?(?=->)/ @@ -75,8 +76,9 @@ emphasis: _I ( _inline{MARKED_TEXT} )+ ( "}" | _N ) _B: /{{(?=[^\{])/ _I: /{(?=[^\{])/ -TEXT.-1: / (?:[^\r\n\{\<](?![^\[\n\r]*->))+ +TEXT.-1: / (?:[^\r\n\{\<](?![^\[\n\r]*->|\?[^\[\n\r]*\]|\[[^\[\n\r]*\]\]))+ | (?:\<(?![0-9A-Za-z_:\/\-\.]+\>))+ + | \\{ /x TABLE_TEXT.-1: /(?:[^\|\r\n\{](?![^\[\n\r]*->))+/ MARKED_TEXT.-1: /(?:[^\}\r\n\{](?![^\[\n\r]*->))+/ diff --git a/test/0.spip b/test/0.spip index d70c2ab..5f590c4 100644 --- a/test/0.spip +++ b/test/0.spip @@ -90,4 +90,7 @@ Au milieu. ---------------------------------------------------------------------------- +Lone angle bracket < oh. +Escaped \{ curly brace. + FIN