mirror of
https://github.com/discourse/discourse.git
synced 2025-06-04 22:34:43 +08:00
FIX: @mentions should not be processed within links
This commit is contained in:
@ -185,6 +185,14 @@ test("Mentions", function() {
|
||||
"<p>Hello <a class=\"mention\" href=\"/users/sam\">@sam</a></p>",
|
||||
"translates mentions to links");
|
||||
|
||||
cooked("[@codinghorror](https://twitter.com/codinghorror)",
|
||||
"<p><a href=\"https://twitter.com/codinghorror\">@codinghorror</a></p>",
|
||||
"it doesn't do mentions within links");
|
||||
|
||||
cookedOptions("[@codinghorror](https://twitter.com/codinghorror)", alwaysTrue,
|
||||
"<p><a href=\"https://twitter.com/codinghorror\">@codinghorror</a></p>",
|
||||
"it doesn't do link mentions within links");
|
||||
|
||||
cooked("Hello @EvilTrout", "<p>Hello <span class=\"mention\">@EvilTrout</span></p>", "adds a mention class");
|
||||
cooked("robin@email.host", "<p>robin@email.host</p>", "won't add mention class to an email address");
|
||||
cooked("hanzo55@yahoo.com", "<p>hanzo55@yahoo.com</p>", "won't be affected by email addresses that have a number before the @ symbol");
|
||||
|
Reference in New Issue
Block a user