ianstormtaylor / slate

A completely customizable framework for building rich text editors. (Currently in beta.)
http://slatejs.org
MIT License
29.71k stars 3.24k forks source link

[Bug] Documentation for Schemas needs a small fix #1672

Closed tashburn closed 6 years ago

tashburn commented 6 years ago

In the documentation for Schema, in the "blocks" section,

{ nodes: ... types: ... }

Should be

{ nodes: ... objects: ... }

cameracker commented 6 years ago

If you're referring to this section https://docs.slatejs.org/slate-core/schema#blocks

Then I think the documentation is correct for the sake of this example and no change is needed. type refers to the subtype of the block, and object refers to the subtype of the node (such as leaf, text, document, block). While, yes, you can have schema rules that dictate what sort of objects a block may contain, for the example where the schema says "lists contain items. items are contained in lists" the use of types here is correct.

If that's not the case, then a larger snippet or more precise permalink might help

ianstormtaylor commented 6 years ago

I'm not exactly sure what you mean. In this case I think a PR is the preferred way to bring up an issue like this, since it will be much more clear, yet just as easy to do.

tashburn commented 6 years ago

You're right, this documentation is fine... my bad.