y-prosemirror icon indicating copy to clipboard operation
y-prosemirror copied to clipboard

fix: unsupported node mark

Open XiaodongTong opened this issue 1 year ago • 5 comments

fix https://github.com/yjs/y-prosemirror/issues/47

Using『node mark』 as an attribute on YElement,Each mark corresponds to an YElement attribute.
Runable in my project.

Hope to merge

XiaodongTong avatar Apr 24 '23 08:04 XiaodongTong

I meet similar sitituation in my custom prosemirror's schema.I'm not sure about when to use mark / attrs for a node.

But in file y-prosemirror/src/lib.js, yXmlFragmentToProsemirrorJSON this function processes only text nodes' marks, and attrs only for non-text nodes.

If marks are designed just for text node, and atts for non-text nodes, y-prosemirror will should not support marks for non-text nodes, as that will be anti prosemirror's design.

It's a pleasure for any suggestion or guidance on how to use marks/attrs correctly, fellows the design.

kkeybbs avatar May 23 '23 16:05 kkeybbs

I meet similar sitituation in my custom prosemirror's schema.I'm not sure about when to use mark / attrs for a node.

But in file y-prosemirror/src/lib.js, yXmlFragmentToProsemirrorJSON this function processes only text nodes' marks, and attrs only for non-text nodes.

If marks are designed just for text node, and atts for non-text nodes, y-prosemirror will should not support marks for non-text nodes, as that will be anti prosemirror's design.

It's a pleasure for any suggestion or guidance on how to use marks/attrs correctly, fellows the design.

I have also need to handle this case

In my understanding,marks act as a way to add attrs to prosemirror document , not only text node.

In tiptap and Confluence Editor , also use mark to effect non-text node

josonyang avatar May 24 '23 15:05 josonyang

Looking good, very useful feature for format compatibility & avoiding data loss.

@XiaodongTong - any plans to fix the final requested change and add tests?

jjgmckenzie avatar May 29 '23 22:05 jjgmckenzie

@dmonad are there any plans to merge this? I also face the very same issue and wanted to raise a PR. Then I noticed this one here. I can also complete this work if you like

hoebbelsB avatar Apr 29 '24 18:04 hoebbelsB