From ba3813e2422d9fe4e252a90242393cada65644dc Mon Sep 17 00:00:00 2001 From: jaschaio Date: Sun, 17 May 2026 15:27:20 +0200 Subject: [PATCH] feat: make detectCustomHtmlPatterns aware of TipTap's actual capabilities MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The previous detection tripped on ANY inline `style=` attribute and on `` elements specifically, which forced templates into HTML-only editing mode whenever the user had used Visual mode features like text color. TipTap's TextStyle + Color + Link extensions (configured in EmailEditor.tsx) natively round-trip exactly that markup -- TipTap emits `` itself when you change a text color, then the detection rejected it as "custom HTML" on the very next load. Empirically about 21% of a 156-template corpus tripped this purely on TipTap-export artifacts (`background-color: initial`, color spans). This rewrite permits what TipTap can represent and rejects only what it can't: * Drop the broad inline-style check entirely (TextStyle/Color/Link preserve inline styles on spans and links). * Remove `` from the custom-elements list (TextStyle handles it). * Expand the custom-elements list to explicitly cover everything TipTap has no extension for: `
`, `
`, `
`, `
`, `