diff --git a/editors/editoria/src/Editoria.js b/editors/editoria/src/Editoria.js index 9bbc674bc52dbd3ac159e43c33a56a1b08dd3bec..375f028f56c3ae01ad17ec58dcb25e268d697170 100644 --- a/editors/editoria/src/Editoria.js +++ b/editors/editoria/src/Editoria.js @@ -52,7 +52,6 @@ const Editoria = () => ( TrackChange // onChange={source => console.log(source)} user={user} - debug /> </Fragment> ); diff --git a/wax-prosemirror-utilities/src/commands/Commands.js b/wax-prosemirror-utilities/src/commands/Commands.js index 555e9f2fd95fbd5906631ae856ccf64507394707..9e6c94a187849dd56ad9e7a78deb9bbf676eb30b 100644 --- a/wax-prosemirror-utilities/src/commands/Commands.js +++ b/wax-prosemirror-utilities/src/commands/Commands.js @@ -2,8 +2,8 @@ import { v4 as uuidv4 } from "uuid"; const setBlockType = (nodeType, attrs = {}) => { return (state, dispatch) => { + const { tr } = state; const { from, to } = state.selection; - const tr = state.tr; state.doc.nodesBetween(from, to, (node, pos) => { if (!node.isTextblock || node.hasMarkup(nodeType, attrs)) return; let applicable = false; diff --git a/wax-prosemirror-utilities/src/schema/SchemaHelpers.js b/wax-prosemirror-utilities/src/schema/SchemaHelpers.js index 40cac9e012a537675757e8afc68e529a7849e209..79134bb58f82bf84d73c68cfa1cb3ee2c375e39f 100644 --- a/wax-prosemirror-utilities/src/schema/SchemaHelpers.js +++ b/wax-prosemirror-utilities/src/schema/SchemaHelpers.js @@ -11,7 +11,7 @@ const parseFormatList = str => { if (!Array.isArray(formatList)) { return []; } - return formatList.filter(format => typeof format === "string"); // ensure there are only strings in list + return formatList.filter(format => typeof format === "string"); }; const parseTracks = str => { @@ -38,14 +38,15 @@ const parseTracks = str => { }; const blockLevelToDOM = node => { - const attrs = node.attrs.track.length - ? { - "data-id": node.attrs.id, - class: node.attrs.class, - "data-track": JSON.stringify(node.attrs.track), - "data-group": node.attrs.group - } - : { class: node.attrs.class }; + const attrs = + node.attrs.track && node.attrs.track.length + ? { + "data-id": node.attrs.id, + class: node.attrs.class, + "data-track": JSON.stringify(node.attrs.track), + "data-group": node.attrs.group + } + : { class: node.attrs.class }; return attrs; };