Skip to content

Commit

Permalink
Merge pull request #23 from EricYin0x/master
Browse files Browse the repository at this point in the history
Fix None description issue
  • Loading branch information
dreikanter committed Feb 21, 2017
2 parents b303a64 + fd8a8be commit 84e960f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion wp2md/wp2md.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,10 @@ def html2md(html):

def generate_toc(meta, items):
"""Generates MD-formatted index page."""
content = meta.get('description', '') + '\n\n'
if not meta.get('description', ''):
content = '\n\n'
else:
content = meta.get('description', '') + '\n\n'
for item in items:
content += str_t("* {post_date}: [{title}]({link})\n").format(**item)
return content
Expand Down

0 comments on commit 84e960f

Please sign in to comment.