]> BookStack Code Mirror - bookstack/blobdiff - resources/js/editor/commands.js
Added inline code and clear formatting
[bookstack] / resources / js / editor / commands.js
index 13fef8330dc58b9dd09894164bff5a0ce76ccf0a..1817bd2a9d7ca4f4f731863ac073c67d07ad1c58 100644 (file)
@@ -26,7 +26,7 @@ export function setBlockAttr(attrName, attrValue) {
                 const nodeAttrs = Object.assign({}, node.attrs);
                 if (node.attrs[attrName] !== undefined) {
                     nodeAttrs[attrName] = attrValue;
-                    tr.setBlockType(pos, pos+1, node.type, nodeAttrs)
+                    tr.setBlockType(pos, pos + 1, node.type, nodeAttrs)
                 }
             });
 
@@ -47,4 +47,13 @@ export function insertBlockBefore(blockType) {
 
         return true
     }
+}
+
+export function removeMarks() {
+    return function (state, dispatch) {
+        if (dispatch) {
+            dispatch(state.tr.removeMark(state.selection.from, state.selection.to, null));
+        }
+        return true;
+    }
 }
\ No newline at end of file