Repository navigation
Rich Text: convert -- to em dash in editor - #77493
shrivastavanolo wants to merge 1 commit into
Conversation
|
Warning: Type of PR label mismatch To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.
Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task. |
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
713a33e to
880eca6
Compare
What?
Closes #73022
Convert
--to an em dash (—) while typing in the RichText editor.Why?
The front end converts
--to—viawp_texturize()but the editor didn't, breaking the WYSIWYG experience.How?
Adds
text-input-rules.jstopackages/rich-text/src/hook/event-listeners/with two rules:--+ any non-hyphen character →—.---is excluded so the separator block transform still fires.__unstableInputRulewas considered but not used as it's designed for format types, not character substitution imo.Testing Instructions
--at the start of a line →—.---at the start of a line → separator block, no em dash.hello--→hello—.Screenshots or screencast
Before
After
Use of AI Tools
Claude (Anthropic) was used to assist with code review and PR description drafting. All code was reviewed and tested by the author.