|
|
@ -254,14 +254,12 @@ class MarkdownBlogParser:
|
|
|
|
# we have a table! how exciting!
|
|
|
|
# we have a table! how exciting!
|
|
|
|
if self.startswith('|'):
|
|
|
|
if self.startswith('|'):
|
|
|
|
# skip headers
|
|
|
|
# skip headers
|
|
|
|
# TODO: validate headers
|
|
|
|
|
|
|
|
headers, span = self.read_until('\n')
|
|
|
|
headers, span = self.read_until('\n')
|
|
|
|
headers = headers.split('|')
|
|
|
|
headers = headers.split('|')
|
|
|
|
if not len(headers) == 4:
|
|
|
|
if not len(headers) == 4:
|
|
|
|
raise ParseError("Expected table header here (like '|Category | Rating / Score |'", span.transform(end=-1))
|
|
|
|
raise ParseError("Expected table header here (like '|Category | Rating / Score |'", span.transform(end=-1))
|
|
|
|
table_name = to_json_field_name(headers[2])
|
|
|
|
table_name = to_json_field_name(headers[2])
|
|
|
|
# skip alignment col
|
|
|
|
# skip alignment col
|
|
|
|
# TODO: validate alignment col
|
|
|
|
|
|
|
|
line, span = self.read_until('\n')
|
|
|
|
line, span = self.read_until('\n')
|
|
|
|
if not len(line.split('|')) == len(headers):
|
|
|
|
if not len(line.split('|')) == len(headers):
|
|
|
|
raise ParseError("Alignment row seems invalid, must contain the same number of '|' as headers!", span.transform(end=-1))
|
|
|
|
raise ParseError("Alignment row seems invalid, must contain the same number of '|' as headers!", span.transform(end=-1))
|
|
|
|