Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SanityContent does not support list, listItem custom rendering #1049

Open
3 tasks done
adalmagro-rs opened this issue Aug 29, 2024 · 0 comments
Open
3 tasks done

SanityContent does not support list, listItem custom rendering #1049

adalmagro-rs opened this issue Aug 29, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@adalmagro-rs
Copy link

Version

module: latest
nuxt: ^3.0.0

Nuxt configuration

Not relevant

Reproduction

Using the SanityContent component and passing some custom serializers as follows:

const serializers = {
    types: {
        code: Code,
        callout: Callout,
        seoImage: SeoImage,
        video: VideoImage
    },
    list: {
        bullet: List,
        number: NumberedList,
    },
    listItem: {
        bullet: ListItem,
        number: ListItem
    },
    block: {
        'blockquote': BlockQuote,
    },
    marks: {
        'externalLink': Link,
        'internalLink': InternalLink,
        'strike-through': 's',
        'keyboard': 'kbd',
        'highlight': 'mark'
    }
}

What is expected?

list and listItem to be rendered as custom component.

What is actually happening?

Rendered HTML is done as expected for marks, styles, types and blocks but neither for list nor listItem. It seems like they are not implemented. Moving to @portabletext/vue instead of SanityContent, these serializers works as expected for all components.

Steps to reproduce

Just use SanityContent with specific serializers for list and listItem and it will be easily reproduced

Additional information

Checklist

  • I have tested with the latest Nuxt version and the issue still occurs
  • I have tested with the latest module version and the issue still occurs
  • I have searched the issue tracker and this issue hasn't been reported yet
@adalmagro-rs adalmagro-rs added the bug Something isn't working label Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants