-
I am building a POC for collaborative book editor, and I need to keep track of who wrote a given block. for example
I imagine that I have to somehow extend the heading and paragraph plugings/spec. Could you give some guidance ? |
Beta Was this translation helpful? Give feedback.
Answered by
kepta
Apr 10, 2021
Replies: 1 comment 1 reply
-
It looks like export const specRegistry = new SpecRegistry([
... other specs
{...paragraph.spec(),
schema: {
...paragraph.spec().schema,
attrs: { userId: { default: '' } }
},
}
]) Read more about node attrs https://prosemirror.net/docs/ref/#model.AttributeSpec |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
rilopez
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It looks like
userId
will be a part of theattrs
.paragraph.spec()
returns a plain object (see this) and you can modify that:Read more about node attrs https://prosemirror.net/docs/ref/#model.AttributeSpec