nib icon indicating copy to clipboard operation
nib copied to clipboard

Use own schema

Open aried3r opened this issue 5 years ago • 2 comments
trafficstars

Hey! Me again :)

From what I've gathered from the code and from https://github.com/nib-edit/Nib/issues/91 it's currently not possible to load a different schema. My use case is that I want to retain a bit of interoperability between different ProseMirror editors (until we settle and migrate to one) and would like to use the original schema.

From what I've seen I think the only difference is that nib uses camelCase instead of snake_case (e.g. bulletList instead of bullet_list). I don't mind, but is there any particular reason behind it? (Just curious, doesn't matter for the issue)

aried3r avatar Jan 23 '20 10:01 aried3r

Hey @aried3r , no specific reason actually, just it comes from prosemirror's example schema. I see in ur case it would make interop hard.

I plan to soon add pluggability to editor, but current plugins will still work for schema they are made to work with.

jpuri avatar Jan 23 '20 14:01 jpuri

I believe the prosemirror-schema-list uses snake_case, while nib-edit explictely overwrite this:

https://github.com/nib-edit/Nib/blob/8cc08f1b9e41c8bec5b6e170f9fc05ec60dee4f1/packages/schema/src/nodes/bulletList.js

Again, no harm done, since it's your editor and all. Was just wondering :)

aried3r avatar Jan 23 '20 14:01 aried3r