fix: direct formatting on a run beats its named character style
A character style is a stylesheet rule, direct formatting an inline style on the run's span. The charStyle mark ranked below TextStyle, so its span sat *inside* and the rule won over the ancestor's inline style — a 9pt style silently undid a run's own 10pt. Priority 102 lifts it above TextStyle's 101. One fixture: 259 → 172 parity issues, lineEnd 49 → 7.
This commit is contained in:
1 parent
d407febd4b
commit
819f51587e
3 files changed
+24
-1
No files matched your search
@@ -16,6 +16,10 @@ declare module '@tiptap/core' {
|
||||
export const CharacterStyle = Mark.create({
|
||||
name: 'charStyle',
|
||||
|
||||
// Above TextStyle's 101, so this span wraps the direct formatting's instead of sitting
|
||||
// inside it: the style is a stylesheet rule, and a rule beats an ancestor's inline style.
|
||||
priority: 102,
|
||||
|
||||
addAttributes() {
|
||||
return {
|
||||
name: {
|
||||
|
||||
Reference in new issue
Block a user