Add markdown-style em and strong format support#62289
Add markdown-style em and strong format support#62289bacoords wants to merge 2 commits intoWordPress:trunkfrom
em and strong format support#62289Conversation
|
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