-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Add markdown-style em
and strong
format support
#62289
base: trunk
Are you sure you want to change the base?
Conversation
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. |
How do users enter actual *text and **text in their content without enforcing the formatting? |
I've considered this before and we were worries about false positives, but maybe that worry is questionable. Input rules can be undone with cmd+z, Backspace, and Escape I believe. |
Yes, the input rules can be undone via CMD+Z and Backspace. |
That assumes the users knows about it. |
I would just note that the convention of transforming text based on special characters already exists. If a user wants to start a paragraph with a hash This would behave similar to the backtick character, in that if you have more than one in a paragraph, it will automatically transform the text in between, but you can undo it with cmd-z. Also it will not automatically transform any text that is copy/pasted or added out of order. |
What?
In the editor, if a user types
*
or_
before and after a word/phrase, the text is then wrapped in<em>
tags. If a user types**
or__
before and after a word/phrase, the text is then wrapped in<strong>
tags.This follows the markdown format, similar to backticks being used for
<code>
, hash characters for headings, lists, horizontal rule, etc.Why?
There is inconsistent support for Markdown-style shortcuts currently.
Closes #62243
How?
Updates the format-library package to include support for italic and bold shortcuts.
Testing Instructions
*
,_
to see italics and**
,__
to see bold.Testing Instructions for Keyboard
Screenshots or screencast
Screen.Recording.2024-06-04.at.8.22.39.AM.mov