diff --git a/spip2md/content.py b/spip2md/content.py index 0531f85..3f8fbfd 100644 --- a/spip2md/content.py +++ b/spip2md/content.py @@ -18,11 +18,10 @@ class content: def test(filename): print(f"--- Parsing of {filename}") parsed = spipParser.parse(open(path.dirname(__file__) + "/" + filename).read()) - print(parsed) - print(parsed.pretty()) - print() + print(parsed, "\n") + print(parsed.pretty(), "\n") # Test test("../test/1.spip") -test("../test/2.spip") +# test("../test/2.spip") diff --git a/spip2md/spip.lark b/spip2md/spip.lark index 4559a85..db78d2f 100644 --- a/spip2md/spip.lark +++ b/spip2md/spip.lark @@ -2,21 +2,21 @@ start: unordered_list | ordered_list | table | SEPARATOR - | _N+ + | N+ | heading | paragraph -unordered_list: ( _N "-*" list_element )+ -ordered_list: ( _N "-#" list_element )+ +unordered_list: ( N "-*" list_element )+ +ordered_list: ( N "-#" list_element )+ list_element: text -table: ( _N row )+ +table: ( N row )+ row: ( "|" cell )+ "|" cell: text -SEPARATOR: _N /-{4,}/ +SEPARATOR: N /-{4,}/ -_N: /\r/? /\n/ +N: /\r/? /\n/ heading: "{{{" text "}}}" diff --git a/test/1.spip b/test/1.spip index e50163f..f255937 100644 --- a/test/1.spip +++ b/test/1.spip @@ -1,4 +1,3 @@ - {{{Chargé de Recherche}}} { {{E-mail:}} } aude.simon@irsamc.ups-tlse.fr