Skip to content
Snippets Groups Projects
Commit c5118ba8 authored by chris's avatar chris
Browse files

add remove block change funcionality

parent 16ac404d
No related branches found
No related tags found
1 merge request!160add track change plugin through service
......@@ -89,6 +89,23 @@ class RejectTrackChange extends Tools {
formatChangeMark,
),
);
} else if (!node.isInline && node.attrs.track) {
const blockChangeTrack = node.attrs.track.find(
track => track.type === 'block_change',
);
if (blockChangeTrack) {
const track = node.attrs.track.filter(
track => track !== blockChangeTrack,
);
tr.setNodeMarkup(
map.map(pos),
state.schema.nodes[blockChangeTrack.before.type],
Object.assign({}, node.attrs, blockChangeTrack.before.attrs, {
track,
}),
node.marks,
);
}
}
});
if (tr.steps.length) dispatch(tr);
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment