From 3d63fbe9c13301f5a4b9cc817019c33ed8a564e2 Mon Sep 17 00:00:00 2001 From: choj Date: Tue, 11 Aug 2020 13:46:35 +0200 Subject: [PATCH] updateMark instead of toggleMark --- src/components/extensions/CustomStyle.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/extensions/CustomStyle.js b/src/components/extensions/CustomStyle.js index dbecf73..7c2b909 100644 --- a/src/components/extensions/CustomStyle.js +++ b/src/components/extensions/CustomStyle.js @@ -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);} } }