diff --git a/tools/specification_parser/specification_parser.py b/tools/specification_parser/specification_parser.py index 27ba8c8e..1cb51174 100644 --- a/tools/specification_parser/specification_parser.py +++ b/tools/specification_parser/specification_parser.py @@ -181,7 +181,7 @@ def content_tree_to_spec(ct): def parse(markdown_file_path): with open(markdown_file_path, "r") as markdown_file: - content_finder = re.compile(r'^(?P#+)(?P[^\n]+)(?P[^#]*)', re.MULTILINE) + content_finder = re.compile(r'^(?P####+)(?P[^\n]+)\n+?.*?\n+?(?P>\s[^#?]*)', re.MULTILINE) parsed = content_finder.findall(markdown_file.read()) return parsed_content_to_heirarchy(parsed)