Releases
@tiptap/extension-text-style@3.4.1
Patch Changes
-
46fa8b8: Prefer the raw inline
style
attribute when parsingcolor
and
background-color
so the original format (hex, rgba/hsla, etc.) is
preserved instead of falling back to the computedelement.style.*
value (which often resolves torgb(...)
).This fixes mismatches where consumers (for example, demo toolbars and
color pickers) expected the original hex values when initializing the
editor from HTML.- The
color
andbackground-color
parsers now look for astyle
attribute first and extract the declared value. If no raw style is
present, they still fall back toelement.style.color
/
element.style.backgroundColor
.
MIGRATION NOTES
- This is a patch-level change. It corrects parsing behavior and is the
least-disruptive fix for the issue. - If your code relied on the parser returning computed
rgb(...)
strings, you may see different string values (for example#958DF1
instead ofrgb(149, 141, 241)
) when HTML contained hex values. - If you need a stable, normalized format for comparisons, normalize the
attribute (for example with a color utility liketinycolor2
) before
comparing or use the editor APIs in a way that doesn't depend on the
exact string representation. - @tiptap/core@3.4.1
- The
@tiptap/react@3.4.1
Patch Changes
- 4dd8d58: fix: @types/react version mismatch
@tiptap/suggestion@3.4.1
Patch Changes
-
59fb86f: Previously,
clientRect
was only obtained throughdecorationNode
. IfdecorationNode
could not be obtained,clientRect
was set tonull
, which caused the suggestion not to render in some IME scenarios (notably Chinese IME).This change adds a fallback method to compute
clientRect
from the editor's cursor position whendecorationNode
is not available. It generates a DOMRect based on the cursor coordinates so the suggestion can render even when the decoration node is missing.