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

feat: add plainText to headings #28

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

benjaminrobinet
Copy link

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 prop

Related issue(s)/PR(s)

Inspired by #17

Copy link
Contributor

@remidej remidej left a 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:

@benjaminrobinet
Copy link
Author

I'm gonna push a fix for that today !
Was thinking if it wouldn't be interesting to also pass the raw object (from the strapi response) to every block types. For now, we only have access to the React.Node

@benjaminrobinet benjaminrobinet marked this pull request as ready for review March 14, 2024 10:27
@benjaminrobinet
Copy link
Author

benjaminrobinet commented Apr 15, 2024

no feedback on this @remidej ? any chance this get merged ? :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants