FEATURE: Support all bbcode tags in the rich editor - #107
Open
renato wants to merge 1 commit into
Open
Conversation
Opening a post that used any of this plugin's tags ([color], [size], [left], [list=a], etc.) in the rich text editor failed with "The rich text editor doesn't support all features used in this post" and forced the markdown editor. Add a rich editor extension covering every tag the plugin supports: inline styling as marks, alignment, [indent], [ot] and [edit] as block nodes, and typed [list=X] lists. A tag value is only accepted when it matches the charsets the cook sanitizer allows, so the editor can't show styling the rendered post drops, and a value can't carry extra style declarations into the editor's DOM. Content the editor can't represent exactly is declined rather than rewritten, leaving the post to the markdown editor with its source intact: values outside those charsets, and a same-type tag nested in one with a differing value, since a mark set holds one mark per type and nested [size] percentages compound when cooked. Cooking changes with it, without changing what a post renders as. Cooked sepquotes carry a data-tag, so [ot] and [edit] are told apart structurally instead of by their localized label, which no longer works once a post is read under another locale. Typed lists get their own token type and every item's content is wrapped in hidden paragraph tokens, which render as nothing but let prosemirror-markdown's own list specs parse them.
renato
force-pushed
the
rich-editor-extension
branch
from
August 5, 2026 18:13
7f0de84 to
407dff7
Compare
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.
Previously, opening a post that used any of this plugin's bbcode tags (
[color],[size],[left],[list=a], etc.) in the rich text editor failed with "The rich text editor doesn't support all features used in this post" and forced the markdown editor.This change adds a rich editor extension that parses and serializes every tag the plugin supports — inline styling as marks, alignment/indent/
[ot]/[edit]as block nodes, and typed[list=X]lists — so bbcode posts open in the rich editor and keep cooking to the same output.List items are now parsed as blocks rather than as a single inline token, so an item can hold nested lists and multiple paragraphs, and
[*]and[li]markers can be mixed in one list. Cooked sepquotes carry adata-tag, so[ot]and[edit]are told apart structurally instead of by their localized label.Two things to note:
[li]items become[*], untyped[list]/[ul]/[ol]become markdown lists, a same-type tag nested in one with the same value drops out, and attribute quoting is canonicalized. Editing a bbcode post in the rich editor rewrites its source accordingly.[size]percentages compound when cooked.