diff options
author | Waylan Limberg <waylan@gmail.com> | 2007-10-11 02:21:42 +0000 |
---|---|---|
committer | Waylan Limberg <waylan@gmail.com> | 2007-10-11 02:21:42 +0000 |
commit | a9b2d38626a95ccad8e4bbdc9d2cc7325ab7b928 (patch) | |
tree | d96f8c018a9269d0f646589756c42c15d6ebb475 /markdown.py | |
parent | ad4a8806b056e966fed410cb127582145b61e234 (diff) | |
download | markdown-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.py | 9 |
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) : |