Skip to content

Commit 631cbb7

Browse files
committed
Fix the generated HTML
1 parent 8abb93e commit 631cbb7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

make

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def create_index():
3535

3636

3737
def create_navigation(file):
38-
content = to_content(file)
38+
content = to_content(file, False)
3939

4040
articles = []
4141
links = content[1].split('\n')
@@ -59,14 +59,14 @@ def create_article(link, title, html, top = None):
5959
return '<article><section><header>%s</header>\n%s</article>' % (title, html)
6060

6161

62-
def to_content(file):
62+
def to_content(file, section=True):
6363
md = open('%s.md' % file).read().decode('utf-8')
6464
title = md.split('\n')[0]
6565
content = md[len(title):].strip()
6666
html = to_markdown(content)
6767

6868
html = html.replace('<blockquote>', '<aside>').replace('</blockquote>', '</aside>')
69-
html = '</section><section><h3>'.join(html.split('<h3>')) + '</section>'
69+
html = '</section><section><h3>'.join(html.split('<h3>')) + ('</section>' if section else '')
7070
html = html.replace('<h3>', '<header><h3>').replace('</h3>', '</h3></header>')
7171
title = title.strip('#').strip()
7272
return (title, content, html)

0 commit comments

Comments
 (0)