From 341fedd9321f44675a0394e61684263ee443bee1 Mon Sep 17 00:00:00 2001 From: Shea Date: Sun, 3 May 2026 15:15:08 +0300 Subject: [PATCH] fix: edit lists crashing and list rendering issue in Firefox (#2920) * one liner fix editor * fix firefox rendering lists * moved fixes * moved fixes per ajbura --- src/app/components/editor/input.ts | 6 ++++-- src/index.css | 6 ++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/app/components/editor/input.ts b/src/app/components/editor/input.ts index 4b6df40..b56e46e 100644 --- a/src/app/components/editor/input.ts +++ b/src/app/components/editor/input.ts @@ -157,10 +157,12 @@ const getInlineElement = (node: ChildNode, processText: ProcessTextCallback): In return children; } - return node.childNodes.flatMap((child) => getInlineElement(child, processText)); + const children = node.childNodes.flatMap((child) => getInlineElement(child, processText)); + if (children.length === 0) return [{ text: '' }]; + return children; } - return []; + return [{ text: '' }]; }; const parseBlockquoteNode = ( diff --git a/src/index.css b/src/index.css index ca28536..d469636 100644 --- a/src/index.css +++ b/src/index.css @@ -129,3 +129,9 @@ textarea { audio:not([controls]) { display: none !important; } + +/* Fix Firefox rendering lists that have empty items with those items collapsed in on eachother */ +li p::before { + content: ''; + display: inline-block; +}