summaryrefslogtreecommitdiffstats
path: root/contrib
diff options
context:
space:
mode:
authorKevin McCarthy <kevin@8t8.us>2021-02-02 12:47:24 -0800
committerKevin McCarthy <kevin@8t8.us>2021-02-02 12:47:24 -0800
commitca272c39308937f70efad4eb2436183720418f1f (patch)
tree39c2d46d548b276d89e6b85ccfb288ff0ed4da7f /contrib
parent6df1891b4ca6b6f5ed484d883de178bcfd7e4a34 (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!
Diffstat (limited to 'contrib')
-rw-r--r--contrib/markdown2html2
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: