nib-edit / nib

Wysiwyg / Text editor components built using React and Prosemirror
https://nib-edit.github.io/nib/
GNU General Public License v3.0
228 stars 26 forks source link

Use own schema #96

Open aried3r opened 4 years ago

aried3r commented 4 years ago

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)

jpuri commented 4 years ago

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.

aried3r commented 4 years ago

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 :)