Skip to content

Commit 712689e

Browse files
committed
Fix to accommodate for check list parsing, that fixes #6
1 parent 63ec1d8 commit 712689e

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

scripts/write_markdown.py

+8-3
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,14 @@ def write_html_from_json(filename, in_path, out_path):
6565
if isinstance(obj, list):
6666
log.debug("File {0} is a text file".format(filename))
6767
for section in obj:
68-
log.info("Writing section {0} to HTML file".format(section['title']))
69-
html_file.write(section['body'])
70-
html_file.write("\n\n")
68+
if 'title' in section and 'body' in section:
69+
log.info("Writing section {0} to HTML file".format(section['title']))
70+
html_file.write(section['body'])
71+
html_file.write("\n\n")
72+
elif 'text' in section:
73+
log.info("Writing check item {0} to HTML file".format(section['text']))
74+
html_file.write(section['text'])
75+
html_file.write("\n\n")
7176
elif filename == "strings.json":
7277
log.debug("File {0} is the strings file for translation.".format(filename) +
7378
" But, I will parse it anyway. Because I'm the best." +

0 commit comments

Comments
 (0)