mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 10:50:21 +08:00
FIX: keep emoji syntax for custom emojis in quotes (#6488)
This commit is contained in:
parent
d408073fc2
commit
57b52cd1de
2 changed files with 13 additions and 1 deletions
|
@ -227,7 +227,7 @@ export class Tag {
|
|||
const src = attr.src || pAttr.src;
|
||||
const cssClass = attr.class || pAttr.class;
|
||||
|
||||
if (cssClass === "emoji") {
|
||||
if (cssClass && cssClass.includes("emoji")) {
|
||||
return attr.title || pAttr.title;
|
||||
}
|
||||
|
||||
|
|
|
@ -340,3 +340,15 @@ QUnit.test("keeps emoji and removes click count", assert => {
|
|||
|
||||
assert.equal(toMarkdown(html), markdown);
|
||||
});
|
||||
|
||||
QUnit.test("keeps emoji syntax for custom emoji", assert => {
|
||||
const html = `
|
||||
<p>
|
||||
<img class="emoji emoji-custom" title=":custom_emoji:" src="https://d11a6trkgmumsb.cloudfront.net/images/emoji/custom_emoji" alt=":custom_emoji:" />
|
||||
</p>
|
||||
`;
|
||||
|
||||
const markdown = `:custom_emoji:`;
|
||||
|
||||
assert.equal(toMarkdown(html), markdown);
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue