From 1615fd5cf441b1047dae6a34265acb9c5cae50b2 Mon Sep 17 00:00:00 2001 From: Matthias Metelka <62722460+kleinerpirat@users.noreply.github.com> Date: Wed, 15 Jun 2022 01:55:36 +0200 Subject: [PATCH] Prevent insertion of breaks into empty fields to allow :empty CSS selector to also work on fields other than the first one. --- ts/editor/rich-text-input/transform.ts | 7 ------- 1 file changed, 7 deletions(-) diff --git a/ts/editor/rich-text-input/transform.ts b/ts/editor/rich-text-input/transform.ts index 33ce0afb8..773499b37 100644 --- a/ts/editor/rich-text-input/transform.ts +++ b/ts/editor/rich-text-input/transform.ts @@ -17,19 +17,12 @@ function adjustInputHTML(html: string): string { return html; } -function adjustInputFragment(fragment: DocumentFragment): void { - if (nodeContainsInlineContent(fragment)) { - fragment.appendChild(document.createElement("br")); - } -} - export function storedToFragment(storedHTML: string): DocumentFragment { /* We need .createContextualFragment so that customElements are initialized */ const fragment = document .createRange() .createContextualFragment(createDummyDoc(adjustInputHTML(storedHTML))); - adjustInputFragment(fragment); return fragment; }