ProseMirror / prosemirror

The ProseMirror WYSIWYM editor
http://prosemirror.net/
MIT License
7.61k stars 336 forks source link

setNodeMarkup stopped keeping node.marks by default #1349

Closed kapouer closed 1 year ago

kapouer commented 1 year ago

Hi,

in the js to ts rewrite, setNodeMarkup changed from

https://github.com/ProseMirror/prosemirror-transform/blob/88935a423fcf38613659002bac25ce7576b64bb0/src/structure.js#L147-L151 to https://github.com/ProseMirror/prosemirror-transform/blob/ee6ad1509d4ba8d099b48690048d2a52789ec0f3/src/structure.ts#L137-L142

This makes setNodeMarkup(pos, null, attrs) drop the node marks, whereas it used to not drop them. I believe this change is a mistake ?

marijnh commented 1 year ago

That was indeed unintentional. Attached patch should help.