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

Merged
merged 3 commits into from
Apr 10, 2025

Conversation

benjaminrobinet
Copy link
Contributor

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
Contributor 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
Contributor Author

benjaminrobinet commented Apr 15, 2024

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

Copy link
Contributor

@jhoward1994 jhoward1994 left a 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!

@jhoward1994 jhoward1994 merged commit f55762f into strapi:main Apr 10, 2025
@hanpaine hanpaine moved this from To be reviewed (Open) to Fixed/Shipped in Developer Experience Squad Apr 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Fixed/Shipped
Development

Successfully merging this pull request may close these issues.

4 participants