Browse Source

updateMark instead of toggleMark

master
choj 3 years ago
parent
commit
3d63fbe9c1
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      src/components/extensions/CustomStyle.js

+ 3
- 3
src/components/extensions/CustomStyle.js View File

@@ -1,5 +1,5 @@
import {Mark} from "tiptap";
import {toggleMark} from "tiptap-commands";
import {toggleMark, updateMark} from "tiptap-commands";


// — Mot - Accronyme
@@ -48,7 +48,7 @@ export default class CustomStyle extends Mark {
{
tag: "span.dede-style",
getAttrs(dom) {
return {type: dom.classList[1]};
return {type: dom.classList};
}
}
],
@@ -59,6 +59,6 @@ export default class CustomStyle extends Mark {
}

commands({type}) {
return attrs => toggleMark(type, attrs);
return attrs => { return updateMark(type, attrs);}
}
}

Loading…
Cancel
Save