diff --git a/.changeset/fix-weird-empty-items-list.md b/.changeset/fix-weird-empty-items-list.md new file mode 100644 index 000000000..6595b3ad9 --- /dev/null +++ b/.changeset/fix-weird-empty-items-list.md @@ -0,0 +1,5 @@ +--- +default: patch +--- + +Fix lists with empty items looking wrong on FireFox diff --git a/src/app/components/editor/input.ts b/src/app/components/editor/input.ts index b2476e437..8f6b3c17d 100644 --- a/src/app/components/editor/input.ts +++ b/src/app/components/editor/input.ts @@ -139,6 +139,7 @@ const getInlineElement = (node: ChildNode, processText: ProcessTextCallback): In } if (isTag(node)) { + if (node.name === 'p' && node?.children?.length === 0) return [{ text: '' }]; const markType = getInlineNodeMarkType(node); if (markType) { return getInlineMarkElement(markType, node, (child) => { diff --git a/src/app/components/message/MsgTypeRenderers.tsx b/src/app/components/message/MsgTypeRenderers.tsx index 399228cc2..83289090a 100644 --- a/src/app/components/message/MsgTypeRenderers.tsx +++ b/src/app/components/message/MsgTypeRenderers.tsx @@ -106,10 +106,15 @@ export function MText({ const customBody = typeof content.formatted_body === 'string' ? content.formatted_body : undefined; + const cleanedMessage = useMemo( + () => customBody?.replace(/
<\/p>)?<\/li>/gi, '