|
@@ -20,23 +20,13 @@ class QuoteTitlesPreprocessor(markdown.preprocessors.Preprocessor):
|
|
def __init__(self, md):
|
|
def __init__(self, md):
|
|
markdown.preprocessors.Preprocessor.__init__(self, md)
|
|
markdown.preprocessors.Preprocessor.__init__(self, md)
|
|
|
|
|
|
- def find_quote_depth(self, line):
|
|
|
|
- depth = 0
|
|
|
|
- try:
|
|
|
|
- while line[0] == '>':
|
|
|
|
- depth += 1
|
|
|
|
- line = line[1:].strip()
|
|
|
|
- except IndexError:
|
|
|
|
- pass
|
|
|
|
- return depth
|
|
|
|
-
|
|
|
|
def run(self, lines):
|
|
def run(self, lines):
|
|
clean = []
|
|
clean = []
|
|
- quote_dept = 0
|
|
|
|
for l, line in enumerate(lines):
|
|
for l, line in enumerate(lines):
|
|
- if quote_dept > self.find_quote_depth(line):
|
|
|
|
|
|
+ if (clean and clean[-1] and clean[-1][0] == '>' and line and
|
|
|
|
+ line[0] != '>'):
|
|
clean.append("")
|
|
clean.append("")
|
|
- quote_dept = self.find_quote_depth(line)
|
|
|
|
|
|
+
|
|
try:
|
|
try:
|
|
if line.strip():
|
|
if line.strip():
|
|
at_match = QUOTE_AUTHOR_RE.match(line.strip())
|
|
at_match = QUOTE_AUTHOR_RE.match(line.strip())
|