diff --git a/parse-md.py b/parse-md.py index 280ab77..9afb8e1 100644 --- a/parse-md.py +++ b/parse-md.py @@ -1,6 +1,7 @@ from dataclasses import dataclass import json import re +import sys from typing import Dict, Tuple from math import ceil, log10 import datetime @@ -205,7 +206,7 @@ class MarkdownBlogParser: def parse(self): line, span = self.read_until('\n', inclusive=True) - result = re.fullmatch(r'### ([\w\s]+)\s+("[^"]+")[ \t]*(\([^)]+\))?\n', line) + result = re.fullmatch(r'### ([\w\s&-/]+)\s+("[^"]+")[ \t]*(\([^)]+\))?\n', line) if not result: raise ParseError("Expected review heading of form '### Company \"pesto name\" (variant)\n'", span.transform(end=-1)) # now we get the first bit of info! @@ -329,5 +330,6 @@ if __name__ == '__main__': }, f, indent=2) except ParseError as err: err.print_context_message() + sys.exit(1)