diff options
author | Kevin McCarthy <kevin@8t8.us> | 2021-02-02 12:47:24 -0800 |
---|---|---|
committer | Kevin McCarthy <kevin@8t8.us> | 2021-02-02 12:47:24 -0800 |
commit | ca272c39308937f70efad4eb2436183720418f1f (patch) | |
tree | 39c2d46d548b276d89e6b85ccfb288ff0ed4da7f | |
parent | 6df1891b4ca6b6f5ed484d883de178bcfd7e4a34 (diff) |
Fix contrib/markdown2html crash.
The script crashes if the last line in the message ends with a colon.
Thanks to Aitor Soroa (@asoroa) for the bug report and patch!
-rw-r--r-- | contrib/markdown2html | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/contrib/markdown2html b/contrib/markdown2html index be705d65..8b7a3f09 100644 --- a/contrib/markdown2html +++ b/contrib/markdown2html @@ -160,7 +160,7 @@ def _identify_quotes_for_later(mdwn): # The lead-in to a quote is a single line immediately preceding the # quote, and ending with ':'. Note that there could be multiple of # these: - if re.match(r'^.+:\s*$', cur) and nxt.startswith('>'): + if nxt and re.match(r'^.+:\s*$', cur) and nxt.startswith('>'): ret.append(f'{{.quotelead}}{cur.strip()}') # pandoc needs an empty line before the blockquote, so # we enter one for the purpose of HTML rendition: |