aboutsummaryrefslogtreecommitdiffstats
path: root/markdown.py
diff options
context:
space:
mode:
authorWaylan Limberg <waylan@gmail.com>2007-10-11 02:21:42 +0000
committerWaylan Limberg <waylan@gmail.com>2007-10-11 02:21:42 +0000
commita9b2d38626a95ccad8e4bbdc9d2cc7325ab7b928 (patch)
treed96f8c018a9269d0f646589756c42c15d6ebb475 /markdown.py
parentad4a8806b056e966fed410cb127582145b61e234 (diff)
downloadmarkdown-a9b2d38626a95ccad8e4bbdc9d2cc7325ab7b928.tar.gz
markdown-a9b2d38626a95ccad8e4bbdc9d2cc7325ab7b928.tar.bz2
markdown-a9b2d38626a95ccad8e4bbdc9d2cc7325ab7b928.zip
Horizontal rules in block quotes with tests. Fixes [1709864].
Diffstat (limited to 'markdown.py')
-rw-r--r--markdown.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/markdown.py b/markdown.py
index f0a2b36..0b7fac0 100644
--- a/markdown.py
+++ b/markdown.py
@@ -442,10 +442,15 @@ HEADER_PREPROCESSOR = HeaderPreprocessor()
class LinePreprocessor (Preprocessor):
"""Deals with HR lines (needs to be done before processing lists)"""
+ blockquote_re = re.compile(r'^(> )+')
+
def run (self, lines) :
for i in range(len(lines)) :
- if self._isLine(lines[i]) :
- lines[i] = self.stash.store("<hr />", safe=True)
+ prefix = ''
+ m = self.blockquote_re.search(lines[i])
+ if m : prefix = m.group(0)
+ if self._isLine(lines[i][len(prefix):]) :
+ lines[i] = prefix + self.stash.store("<hr />", safe=True)
return lines
def _isLine(self, block) :