Error while trying to remove a `link` Mark from a TextNode

I am not sure if its a bug, so posting it here. I am quite new with prosemirror. I am trying to remove link Mark from a TextNode by:

// tried different positions of form. None worked.
view.dispatch(view.state.tr.setNodeMarkup(from, null, null, newMarks))

And getting error here:

if (this.isText) { throw new Error("NodeType.create can't construct text nodes") }

Can somebody help me out here? Let me know if more info is needed. Thanks

tr.addMark() and tr.removeMark(), are the ones I needed. Working fine now.

1 Like