Skip to content
Snippets Groups Projects

Track changes

Merged Christos requested to merge track-changes into master
1 file
+ 23
1
Compare changes
  • Side-by-side
  • Inline
@@ -8,7 +8,29 @@ class AcceptTrackChange extends Tools {
content = 'Accept';
get run() {
return (state, dispatch) => {};
return (state, dispatch) => {
const {
selection: { from, to },
} = state;
state.doc.nodesBetween(from, to, (node, pos) => {
if (
node.marks &&
node.marks.find(mark => mark.type.name === 'insertion')
) {
const insertionMark = node.marks.find(
mark => mark.type.name === 'insertion',
);
dispatch(
state.tr.removeMark(
insertionMark.pos,
insertionMark.pos + node.nodeSize,
state.schema.marks.insertion,
),
);
}
});
};
}
get active() {