fix: Server error viewing history with emoji in document, closes #4092
This commit is contained in:
@@ -44,20 +44,16 @@ export default class Emoji extends Node {
|
||||
],
|
||||
toDOM: (node) => {
|
||||
if (nameToEmoji[node.attrs["data-name"]]) {
|
||||
const text = document.createTextNode(
|
||||
nameToEmoji[node.attrs["data-name"]]
|
||||
);
|
||||
return [
|
||||
"strong",
|
||||
{
|
||||
class: `emoji ${node.attrs["data-name"]}`,
|
||||
"data-name": node.attrs["data-name"],
|
||||
},
|
||||
text,
|
||||
nameToEmoji[node.attrs["data-name"]],
|
||||
];
|
||||
}
|
||||
const text = document.createTextNode(`:${node.attrs["data-name"]}:`);
|
||||
return ["strong", { class: "emoji" }, text];
|
||||
return ["strong", { class: "emoji" }, `:${node.attrs["data-name"]}:`];
|
||||
},
|
||||
toPlainText: (node) => nameToEmoji[node.attrs["data-name"]],
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user