parsing into normal flow
This commit is contained in:
parent
79a50d5e83
commit
08973616b0
@ -11,20 +11,10 @@ class content:
|
||||
|
||||
def get_markdown(self):
|
||||
markdown = self.spip
|
||||
# Parses the body & display parse tree
|
||||
try:
|
||||
parsed = spipParser.parse(self.spip)
|
||||
print(f" parse tree :\n", parsed.pretty(), "\n")
|
||||
except Exception as e:
|
||||
print(" PARSING FAILED :\n", e)
|
||||
return markdown
|
||||
|
||||
|
||||
# Parses a file & display its parse tree
|
||||
def test(filename):
|
||||
print(f"--- Parsing of {filename} ---\n")
|
||||
parsed = spipParser.parse(open(path.dirname(__file__) + "/" + filename).read())
|
||||
print(parsed, "\n")
|
||||
print(f"--- Parse tree of {filename} ---\n\n", parsed.pretty(), "\n")
|
||||
|
||||
|
||||
# Test
|
||||
test("../test/0.spip")
|
||||
test("../test/1.spip")
|
||||
test("../test/2.spip")
|
||||
test("../test/3.spip")
|
||||
test("../test/4.spip")
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!python3
|
||||
#!python
|
||||
import sys
|
||||
from os import mkdir
|
||||
from shutil import rmtree
|
||||
|
Loading…
Reference in New Issue
Block a user