Feat: more text formats in the WYSIWYG toolbar - #21
Open
charlie404 wants to merge 1 commit into
Open
Conversation
Adds strike, superscript, subscript and inline code. Strike gets its own button, the three others are grouped in a hover dropdown so the bubble still fits the minimum sidebar width. Also in the toolbar: - the link form gets a "New tab" checkbox, and stays open with a message when Tiptap rejects the URL instead of dropping what was typed - the color palette gets a "No color" swatch, so a color can be removed without clearing the rest of the formatting - the bubble keeps a small gap with the sidebar border when the selection is close to it, instead of being clamped flush against it Behaviour notes: - superscript and subscript exclude each other at the schema level, so the keyboard shortcuts cannot stack them either - inline code no longer excludes every other mark, it can be combined with bold, a link or a color like the other formats - links no longer get target="_blank" rel="nofollow" by default, these attributes are now set only when the checkbox is ticked @tiptap/extension-color is dropped: TextStyleKit already registers it, and the duplicate was logging a warning for every mounted editor.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a few formats that were missing from the
HTMLTextbubble toolbar, plus two small quality of life changes on the link form and the color palette.What is added
<s>), as its own button next to the highlighter.target="_blank" rel="noopener noreferrer".Clearwas the only way before, and it wipes everything).Behaviour worth a look during review
target="_blank" rel="noopener noreferrer nofollow". That was the Tiptap default applied to every link created from the toolbar; the attributes are now written only when the checkbox is ticked. Content saved before this change round-trips untouched, the parsed attributes are preserved.Mod+.andMod+,cannot stack them either, and pasted<sup><sub>collapses to one mark.excludes: '_'), applying code silently dropped an existing link or color, and bold/italic/color became no-ops on code without any feedback. It now behaves like the other inline formats.@tiptap/extension-coloris dropped.TextStyleKitalready registers it, so the two were loggingDuplicate extension names found: ['color']for every mounted editor.setColor/unsetColorstill come fromTextStyleKit.www.is prefixed withhttps://, sinceisAllowedUrirejects a bare host followed by a path.shiftpadding so it keeps a small gap with the sidebar border when the selection sits near the edge of a field. Without it, it was clamped flush against the border and looked cut off.Checks
tsc,vitestand the build pass. The toolbar was exercised in the browser on the Vite playground: every button and its keyboard shortcut, single line and multiline fields, the link form with and without the checkbox, an invalid URL, the color reset, and a round-trip of content saved with the previous version.The Cypress suite was not run locally (the 15.6 binary does not start on macOS 26 here), so it relies on CI.