diff --git a/omg.py b/omg.py index f797fd1..14ecea6 100755 --- a/omg.py +++ b/omg.py @@ -91,10 +91,19 @@ class OMG: "links": [] } + codeblock = False + for line in content.split("\n"): if line == "": continue + if line.startswith("```"): # detect codeblocks and ignore everything inside it + codeblock = not codeblock + continue + + if codeblock: + continue + # ==== headings ==== if line.startswith("#"): # heading or tag tokens = line.split()