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

Typography: Allow overriding replacements #2598

Closed
1 task done
Haraldson opened this issue Mar 7, 2022 · 5 comments · Fixed by #4287
Closed
1 task done

Typography: Allow overriding replacements #2598

Haraldson opened this issue Mar 7, 2022 · 5 comments · Fixed by #4287
Assignees
Labels
Type: Feature The issue or pullrequest is a new feature

Comments

@Haraldson
Copy link

Haraldson commented Mar 7, 2022

What problem are you facing?

In order to support multiple languages and their individual typographic rules, it would be nice to be able to override replacements. Straight double quotes (") to curly double quotes () makes sense in English, but in Norwegian I would prefer the straight opening quote to turn into double angle quotes («) instead.

What’s the solution you would like to see?

I tried reading available documentation, then look through the source code, and discovered an existing prop/option named replaceWith. It would be nice if that prop could be sent in using Typography.configure() somehow. Below is a couple of ways this could be achieved:

Typography.configure({
    openDoubleQuote: {
        replaceWith: formatMessage({
            id: 'quote_double_open',
            defaultMessage: '“'
        })
    },
    closeDoubleQuote: formatMessage({
        id: 'quote_double_close',
        defaultMessage: '”'
    })
})

What alternatives did you consider?

I guess I could roll my own extension, but I’d much prefer a Typography extension to be language-aware, since typography is tied to languages and not a global standard.

Anything to add? (optional)

No response

Are you sponsoring us?

  • Yes, I’m a sponsor. 💖
@Haraldson Haraldson added the Type: Feature The issue or pullrequest is a new feature label Mar 7, 2022
@stale
Copy link

stale bot commented Jul 6, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jul 6, 2022
@Haraldson
Copy link
Author

I still need this.

@stale stale bot removed stale labels Jul 7, 2022
@bdbch
Copy link
Contributor

bdbch commented Sep 14, 2022

Hey @Haraldson! I'll take it into our list of features planned for the future. Thanks for your request.

@github-actions
Copy link
Contributor

This issue is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 7 days

@github-actions github-actions bot added the Info: Stale The issue or pullrequest has not been updated in a while and might be stale label Feb 26, 2023
@bdbch bdbch removed the Info: Stale The issue or pullrequest has not been updated in a while and might be stale label Feb 26, 2023
@github-actions
Copy link
Contributor

This issue is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 7 days

@github-actions github-actions bot added the Info: Stale The issue or pullrequest has not been updated in a while and might be stale label Jun 13, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jun 21, 2023
@bdbch bdbch removed the Info: Stale The issue or pullrequest has not been updated in a while and might be stale label Jun 21, 2023
@bdbch bdbch reopened this Jun 21, 2023
@bdbch bdbch added this to Tiptap Aug 4, 2023
@bdbch bdbch moved this to Triage open in Tiptap Aug 4, 2023
@bdbch bdbch moved this from Triage open to Backlog in Tiptap Aug 4, 2023
@bdbch bdbch self-assigned this Aug 4, 2023
@bdbch bdbch moved this from Backlog to In Progress in Tiptap Aug 4, 2023
@bdbch bdbch moved this from In Progress to Ready for Review in Tiptap Aug 4, 2023
@github-project-automation github-project-automation bot moved this from Ready for Review to Done in Tiptap Aug 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Feature The issue or pullrequest is a new feature
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants