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

fix(helpers): add missing dir attribute for right-to-left languages #211

Merged
merged 1 commit into from
Oct 30, 2024

Conversation

lihbr
Copy link
Member

@lihbr lihbr commented Oct 29, 2024

Resolves: https://prismic-team.slack.com/archives/C014VAACCQL/p1729780207755199

Description

This PR updates the default richtext serializer to honor the direction property of rich text nodes and adds the appropriate dir attribute on right-to-left text nodes. undefined should serialize to "no attribute" in React according to the types.

P.S. Are we considering releasing a major of this kit to eliminate the dependency on @prismicio/types/@prismicio/richtext? It's not that much of a big deal for now but might cause more issues later on.

Related:

Checklist

  • If my changes require tests, I added them.
  • If my changes affect backward compatibility, it has been discussed.
  • If my changes require an update to the CONTRIBUTING.md guide, I updated it.

Preview

How to QA 1

Footnotes

  1. Please use these labels when submitting a review:
    ❓ #ask: Ask a question.
    💡 #idea: Suggest an idea.
    ⚠️ #issue: Strongly suggest a change.
    🎉 #nice: Share a compliment.

Copy link

size-limit report 📦

Path Size
./dist/index.cjs 8.19 KB (+0.48% 🔺)
./dist/index.js 6.13 KB (+0.78% 🔺)
./dist/react-server.cjs 7.39 KB (+0.5% 🔺)
./dist/react-server.js 5.64 KB (+0.67% 🔺)

@angeloashmore
Copy link
Member

@lihbr: P.S. Are we considering releasing a major of this kit to eliminate the dependency on @prismicio/types/@prismicio/richtext? It's not that much of a big deal for now but might cause more issues later on.

Yes, we will want to move to pure @prismicio/client eventually. As it is not necessary right now, I'd prefer holding off from making a breaking change.

Copy link
Member

@angeloashmore angeloashmore left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@lihbr lihbr merged commit b5139ec into master Oct 30, 2024
1 check passed
@lihbr lihbr deleted the lh/fix-add-missing-dir-attribute branch October 30, 2024 10:50
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