##// END OF EJS Templates
Use multiline preparser (treat line breaks as line start)
neko259 -
r887:4c64bb9d default
parent child Browse files
Show More
@@ -173,7 +173,7 b' class PostManager(models.Manager):'
173 """
173 """
174
174
175 for key, value in PREPARSE_PATTERNS.items():
175 for key, value in PREPARSE_PATTERNS.items():
176 text = re.sub(key, value, text)
176 text = re.sub(key, value, text, flags=re.MULTILINE)
177
177
178 return text
178 return text
179
179
@@ -4,8 +4,9 b' from boards.models import Post'
4
4
5 class ParserTest(TestCase):
5 class ParserTest(TestCase):
6 def test_preparse_quote(self):
6 def test_preparse_quote(self):
7 raw_text = '>quote'
7 raw_text = '>quote\nQuote in >line\nLine\n>Quote'
8 preparsed_text = Post.objects._preparse_text(raw_text)
8 preparsed_text = Post.objects._preparse_text(raw_text)
9
9
10 self.assertEqual('[quote]quote[/quote]', preparsed_text,
10 self.assertEqual(
11 'Quote not preparsed.') No newline at end of file
11 '[quote]quote[/quote]\nQuote in >line\nLine\n[quote]Quote[/quote]',
12 preparsed_text, 'Quote not preparsed.') No newline at end of file
General Comments 0
You need to be logged in to leave comments. Login now