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

add id attribute on creation of new paragraph

parent 9c3fbe4b
No related branches found
No related tags found
1 merge request!117Current features fixes
import { v4 as uuidv4 } from "uuid";
const markInsertion = (tr, from, to, user, date, group) => { const markInsertion = (tr, from, to, user, date, group) => {
tr.removeMark(from, to, tr.doc.type.schema.marks.deletion); tr.removeMark(from, to, tr.doc.type.schema.marks.deletion);
tr.removeMark(from, to, tr.doc.type.schema.marks.insertion); tr.removeMark(from, to, tr.doc.type.schema.marks.insertion);
...@@ -36,7 +38,7 @@ const markInsertion = (tr, from, to, user, date, group) => { ...@@ -36,7 +38,7 @@ const markInsertion = (tr, from, to, user, date, group) => {
tr.setNodeMarkup( tr.setNodeMarkup(
pos, pos,
null, null,
Object.assign({}, node.attrs, { track, group }), Object.assign({}, node.attrs, { track, group, id: uuidv4() }),
node.marks node.marks
); );
} }
......
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