-
Notifications
You must be signed in to change notification settings - Fork 32
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
feat: add plainText to headings #28
feat: add plainText to headings #28
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes look good! I think there are just a couple places you'll need to update:
- the types:
plainText?: T extends { type: 'code' } ? string : never; - the readme: https://github.com/strapi/blocks-react-renderer/blob/4c6faf1d62f5c513545e4150e1b02170660c289e/README.md#custom-components
I'm gonna push a fix for that today ! |
no feedback on this @remidej ? any chance this get merged ? :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested and works well, thanks!
What does it do?
It allows to have access to the plainText of a heading block.
Why is it needed?
Sometimes you might want to have access to the plain text of a heading to be able to add an attribute to it, like for creating anchors to point to them.
How to test it?
In a frontend app, use the renderer (link it via yarn), and pass a custom component for
heading
that uses the plainText propRelated issue(s)/PR(s)
Inspired by #17