diff --git a/composables/content-parse.ts b/composables/content-parse.ts index 6ab6954a..d5db2fe9 100644 --- a/composables/content-parse.ts +++ b/composables/content-parse.ts @@ -169,7 +169,7 @@ export function treeToText(input: Node): string { if ('children' in input) body = (input.children as Node[]).map(n => treeToText(n)).join('') - if (input.name === 'img') { + if (input.name === 'img' || input.name === 'picture') { if (input.attributes.class?.includes('custom-emoji')) return `:${input.attributes['data-emoji-id']}:` if (input.attributes.class?.includes('iconify-emoji')) @@ -326,11 +326,34 @@ function replaceCustomEmoji(customEmojis: Record code frame no lang 1`] = `"

 custom emoji 1`] = `
 "Daniel Roe
-\\":nuxt:\\"
+
+  \\":nuxt:\\"
 "
 `;
 
diff --git a/tests/__snapshots__/html-parse.test.ts.snap b/tests/__snapshots__/html-parse.test.ts.snap
index df59da5a..b2546e6b 100644
--- a/tests/__snapshots__/html-parse.test.ts.snap
+++ b/tests/__snapshots__/html-parse.test.ts.snap
@@ -48,12 +48,16 @@ const a = hello
 
 exports[`html-parse > custom emoji > html 1`] = `
 "Daniel Roe
-\\":nuxt:\\"
+
+  \\":nuxt:\\"
 "
 `;