sanity-io / block-content-to-react

Deprecated in favor of @portabletext/react
https://github.com/portabletext/react-portabletext
MIT License
161 stars 25 forks source link

Can't create list in sanity #48

Closed BrkatiDzo closed 3 years ago

BrkatiDzo commented 3 years ago

I can't get list items from the editor/schema

--mySchema export default { title: "Block Content", name: "blockContent", type: "array", of: [ { title: "Block", type: "block", // Styles let you set what your user can mark up blocks with. These // correspond with HTML tags, but you can set any title or value // you want and decide how you want to deal with it where you want to // use your content. styles: [ { title: "Normal", value: "normal" }, { title: "H1", value: "h1" }, { title: "H2", value: "h2" }, { title: "H3", value: "h3" }, { title: "H4", value: "h4" }, { title: "Quote", value: "blockquote" }, ], lists: [ { title: "Bullet", value: "bullet" }, { title: "Numbered", value: "number" } ], // Marks let you mark up inline text in the block editor. marks: { // Decorators usually describe a single property – e.g. a typographic // preference or highlighting by editors. decorators: [ { title: "Strong", value: "strong" }, { title: "Emphasis", value: "em" }, ], // Annotations can be any object structure – e.g. a link or a footnote. annotations: [ { title: "URL", name: "link", type: "object", fields: [ { title: "URL", name: "href", type: "url", }, ], }, ], }, }, // You can add additional types here. Note that you can't use // primitive types such as 'string' and 'number' in the same array // as a block type. { type: "image", options: { hotspot: true }, }, ], };

editor

Screenshot 2021-06-15 at 17 47 21

response

Screenshot 2021-06-15 at 17 46 49

tried with a lot of variations of serializer like here: https://github.com/sanity-io/block-content-to-react/issues/29 https://github.com/sanity-io/block-content-to-react/issues/33

but it just doesn't read the list items.

miancc commented 2 years ago

Hi @BrkatiDzo I hope you area okay, I would like know if you have a solution to this issue, I have the same problem.

davincios commented 2 years ago

Super frustrating that it doesn't read list items. Is there any work around?