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

Blocks that has _type different from "block" doesn't get correct list processing #47

Closed fabien closed 1 year ago

fabien commented 3 years ago

Cross-posting because it probably originates here: https://github.com/sanity-io/next-sanity/issues/20

judofyr commented 3 years ago

Thanks for the report!

From this library's point of view it's correct that you'll have manually declare block.content to use the built-in block serializer. It's definitely a bug that this causes list items to not be processed correctly. I'm renaming this issue to reflect that.

I think this might be the problem: https://github.com/sanity-io/block-content-to-hyperscript/blob/a03e7f496d6faa68ce1b16e7031d2d47cb65aeb2/src/blocksToNodes.js#L109-L111.

rexxars commented 1 year ago

Closing this, as the new @portabletext/react library is the successor to this module. Please see https://github.com/portabletext/react-portabletext