Show More
@@ -65,7 +65,7 b' PREPARSE_PATTERNS = {' | |||
|
65 | 65 | r'>>(\d+)': r'[post]\1[/post]', # Reflink ">>123" |
|
66 | 66 | r'^>([^>].+)': r'[quote]\1[/quote]', # Quote ">text" |
|
67 | 67 | r'^//(.+)': r'[comment]\1[/comment]', # Comment "//text" |
|
68 | r'@(\w+)': r'[user]\1[/user]', # User notification "@user" | |
|
68 | r'\B@(\w+)': r'[user]\1[/user]', # User notification "@user" | |
|
69 | 69 | } |
|
70 | 70 | |
|
71 | 71 |
@@ -25,3 +25,10 b' class ParserTest(TestCase):' | |||
|
25 | 25 | self.assertEqual('[post]12[/post]\nText', |
|
26 | 26 | preparsed_text, 'Reflink not preparsed.') |
|
27 | 27 | |
|
28 | def preparse_user(self): | |
|
29 | raw_text = '@user\nuser@example.com\n@user\nuser @user' | |
|
30 | preparsed_text = Post.objects._preparse_text(raw_text) | |
|
31 | ||
|
32 | self.assertEqual('[user]user[/user]\nuser@example.com\n[user]user[/user]\nuser [user]user[/user]', | |
|
33 | preparsed_text, 'User link not preparsed.') | |
|
34 |
General Comments 0
You need to be logged in to leave comments.
Login now