Index: cms/converters.py |
=================================================================== |
--- a/cms/converters.py |
+++ b/cms/converters.py |
@@ -117,16 +117,19 @@ |
self._append_text(self.unescape('&#{};'.format(name))) |
def parse_page_content(page, data): |
"""Separate page content into metadata (dict) and body text (str)""" |
page_data = {'page': page} |
lines = data.splitlines(True) |
for i, line in enumerate(lines): |
+ if line.strip() == '<!--' or line.strip() == '-->': |
Vasily Kuznetsov
2017/08/14 11:20:07
I like this less than my version because of duplic
|
+ lines[i] = '' |
+ continue |
if not re.search(r'^\s*[\w\-]+\s*=', line): |
break |
name, value = line.split('=', 1) |
value = value.strip() |
if value.startswith('[') and value.endswith(']'): |
value = [element.strip() for element in value[1:-1].split(',')] |
lines[i] = '\n' |
page_data[name.strip()] = value |