summaryrefslogtreecommitdiff
path: root/megapixels/app
diff options
context:
space:
mode:
Diffstat (limited to 'megapixels/app')
-rw-r--r--megapixels/app/site/parser.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/megapixels/app/site/parser.py b/megapixels/app/site/parser.py
index 5f373937..6c6ad688 100644
--- a/megapixels/app/site/parser.py
+++ b/megapixels/app/site/parser.py
@@ -55,8 +55,10 @@ def format_metadata(section):
return "<section><div class='meta'>{}</div></section>".format(''.join(meta))
def format_applet(section, s3_path):
- payload = section.replace('```', '').strip().split('\n')
+ print(section)
+ payload = section.strip('```').strip().split('\n')
applet = {}
+ print(payload)
if ': ' in payload[0]:
command, opt = payload[0].split(': ')
else:
@@ -85,7 +87,14 @@ def parse_markdown(sections, s3_path, skip_h1=False):
continue
elif section.startswith('```'):
groups.append(format_section(current_group, s3_path))
- groups.append(format_applet(section, s3_path))
+ current_group = []
+ current_group.append(section)
+ if section.endswith('```'):
+ groups.append(format_applet("\n\n".join(current_group), s3_path))
+ current_group = []
+ elif section.endswith('```'):
+ current_group.append(section)
+ groups.append(format_applet("\n\n".join(current_group), s3_path))
current_group = []
elif section.startswith('+ '):
groups.append(format_section(current_group, s3_path))