Browse Source

Smaller fix for quotes

Rafał Pitoń 11 years ago
parent
commit
5214c443a1
1 changed files with 3 additions and 13 deletions
  1. 3 13
      misago/markdown/extensions/quotes.py

+ 3 - 13
misago/markdown/extensions/quotes.py

@@ -20,23 +20,13 @@ class QuoteTitlesPreprocessor(markdown.preprocessors.Preprocessor):
     def __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):
         clean = []
-        quote_dept = 0
         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("")
-            quote_dept = self.find_quote_depth(line)
+
             try:
                 if line.strip():
                     at_match = QUOTE_AUTHOR_RE.match(line.strip())