fix: insert space around custom emojis
parent
6412127283
commit
ff0ad77676
|
@ -120,7 +120,7 @@ export function treeToText(input: Node): string {
|
||||||
|
|
||||||
// add spaces around emoji to prevent parsing errors: 2 or more consecutive emojis will not be parsed
|
// add spaces around emoji to prevent parsing errors: 2 or more consecutive emojis will not be parsed
|
||||||
if (input.name === 'img' && input.attributes.class?.includes('custom-emoji'))
|
if (input.name === 'img' && input.attributes.class?.includes('custom-emoji'))
|
||||||
return `:${input.attributes['data-emoji-id']}:`
|
return ` :${input.attributes['data-emoji-id']}: `
|
||||||
|
|
||||||
if (input.name === 'em-emoji')
|
if (input.name === 'em-emoji')
|
||||||
return `${input.attributes.native}`
|
return `${input.attributes.native}`
|
||||||
|
|
|
@ -85,7 +85,6 @@ body {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
max-height: 1.3em;
|
max-height: 1.3em;
|
||||||
max-width: 1.3em;
|
max-width: 1.3em;
|
||||||
margin: 0 0.2em;
|
|
||||||
vertical-align: text-bottom;
|
vertical-align: text-bottom;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -132,6 +131,10 @@ body {
|
||||||
.content-editor {
|
.content-editor {
|
||||||
--at-apply: outline-none flex-1;
|
--at-apply: outline-none flex-1;
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
|
|
||||||
|
.custom-emoji {
|
||||||
|
margin: 0 0.2em;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.skeleton-loading-bg {
|
.skeleton-loading-bg {
|
||||||
|
|
|
@ -52,7 +52,7 @@ exports[`html-parse > custom emoji > html 1`] = `
|
||||||
"
|
"
|
||||||
`;
|
`;
|
||||||
|
|
||||||
exports[`html-parse > custom emoji > text 1`] = `"Daniel Roe :nuxt:"`;
|
exports[`html-parse > custom emoji > text 1`] = `"Daniel Roe :nuxt:"`;
|
||||||
|
|
||||||
exports[`html-parse > emojis > html 1`] = `
|
exports[`html-parse > emojis > html 1`] = `
|
||||||
"<em-emoji native=\\"🇫🇷\\" fallback=\\"🇫🇷\\"></em-emoji>
|
"<em-emoji native=\\"🇫🇷\\" fallback=\\"🇫🇷\\"></em-emoji>
|
||||||
|
|
Loading…
Reference in New Issue