mirror of
https://github.com/discourse/discourse.git
synced 2024-11-27 07:33:36 +08:00
FIX: Quoting a mention with status emoji breaks the mention (#19530)
This commit is contained in:
parent
8f9933d1dd
commit
2031b75055
|
@ -379,6 +379,10 @@ export class Tag {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cssClass?.includes("emoji")) {
|
if (cssClass?.includes("emoji")) {
|
||||||
|
if (cssClass.includes("user-status")) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
return attr.title || pAttr.title;
|
return attr.title || pAttr.title;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -353,6 +353,18 @@ helloWorld();</code>consectetur.`;
|
||||||
assert.strictEqual(toMarkdown(html), markdown);
|
assert.strictEqual(toMarkdown(html), markdown);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test("strips user status from mentions", function (assert) {
|
||||||
|
const statusHtml = `
|
||||||
|
<img class="emoji user-status"
|
||||||
|
src="/images/emoji/twitter/desert_island.png?v=12"
|
||||||
|
title="vacation">
|
||||||
|
`;
|
||||||
|
const html = `Mentioning <a class="mention" href="/u/andrei">@andrei${statusHtml}</a>`;
|
||||||
|
const expectedMarkdown = `Mentioning @andrei`;
|
||||||
|
|
||||||
|
assert.strictEqual(toMarkdown(html), expectedMarkdown);
|
||||||
|
});
|
||||||
|
|
||||||
test("keeps hashtag-cooked and converts to bare hashtag with type", function (assert) {
|
test("keeps hashtag-cooked and converts to bare hashtag with type", function (assert) {
|
||||||
const html = `
|
const html = `
|
||||||
<p dir="ltr">This is <a class="hashtag-cooked" href="/c/ux/14" data-type="category" data-slug="ux">
|
<p dir="ltr">This is <a class="hashtag-cooked" href="/c/ux/14" data-type="category" data-slug="ux">
|
||||||
|
|
Loading…
Reference in New Issue
Block a user