-
Notifications
You must be signed in to change notification settings - Fork 48
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
feat(rich-text-editor): Add tagLink, subscript, superscript, kbd, and spoiler input #158
Conversation
✅ Deploy Preview for nifty-lalande-39c157 ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
The tag link shouldn't support multiple words. There's existing validation for allowed tag names in |
- util method to validate tagName content - test update to cover disabled tag input - renamed shortcut
@aalear Thanks for the heads-up. I pushed some changes to better validate the links. Now you can only convert the selection if the trimmed content doesn't have any whitespace. (trimmed because double clicking words in Chrome on Windows also selects the space after the word) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! I have added some suggestions for changes inline
@b-kelly I think I've addressed everything save for my comment about I also added |
I pushed updates to the keyboard shortcuts for superscript and subscript to match most other editor conventions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note - blocked by #157, which also exposes toggleWrapIn
, adding tests and docs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Imo, the rich-text version is ready for merge. Any chance we can get the dropdown menu in markdown mode as well? I'd like to keep the menus as aligned as possible. If this is an outsized request, we can consider getting this PR merged first.
@@ -70,6 +71,19 @@ export function allKeymaps( | |||
...bindLetterKeymap("Mod-h", toggleHeadingLevel()), | |||
...bindLetterKeymap("Mod-r", insertHorizontalRuleCommand), | |||
...bindLetterKeymap("Mod-m", setBlockType(schema.nodes.code_block)), | |||
...bindLetterKeymap( | |||
"Mod-[", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reviewer's note: mod+[/]
are commonly used in IDEs to (un)indent a line. This shouldn't pose too much of an issue though, as we can chain commands together, placing the code indent command first, falling back to creating a taglink.
No action necessary.
124e993
to
e49a2f8
Compare
I think we should get this merged and follow up with the Markdown menu items. I don't have a ton of time this sprint to dig into it myself. |
Closes #51.
Describe your changes
This PR adds four new features to the Rich Text editor that were previously Markdown-only. All include keyboard shortcuts as well as manual entry via a new overflow dropdown menu option.
These include the following:
TagLinks CTRL-[
Subscript Ctrl - ; and Superscript Ctrl - :
Spoiler CTRL-]
PR Checklist
/** ... */
docsbug
/enhancement
and other labels as appropriateEnvironment(s) tested