Repository navigation
Preserve HTML embeds when editing Docs - #5306
Closed
alanagoyal wants to merge 10 commits into
Closed
alanagoyal wants to merge 10 commits into
alanagoyal wants to merge 10 commits into
Conversation
Write raw HTML through the serializer's line-aware text output so blocks inside blockquotes and list items keep their prefixes. Pair inline formatting tags into a mark that displays the formatting and saves the original tags; unsupported or unpaired inline HTML still shows as source. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Tables that cannot be written as Markdown, such as ones with a multi-line cell, are saved as HTML. Load that HTML back as a table when it matches the editor's own output exactly, and write inline raw HTML inside it as attribute-carrying elements instead of visible placeholder text. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…tact Tables saved as HTML now contain each inline tag's original source rather than editor markup. An ::html directive followed by text stays a directive, and bold or italic around an inline tag keeps its delimiters. The proposal baseline test expects an HTML paragraph block to show as source again. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…le checks Inline tag pairing now runs in linear time per paragraph and leaves mis-nested tags as source. Pasted HTML no longer carries hidden original tags into the document. Each HTML table's editability check is cached across parses. Co-Authored-By: Claude Opus 5.5 <[email protected]>
HTML the editor can represent without losing anything, judged by comparing the original with the editor's rendering after ignoring whitespace and Tiptap's table defaults, now displays as normal content. Other HTML blocks become editable source blocks, other inline tags become editable inline source, and <br> stays a line break. Source is saved exactly as typed. Co-Authored-By: Claude Opus 5.5 <[email protected]>
HTML now displays as normal content only when saving it as Markdown and reloading reproduces it, so images in table cells, pipes in cell code, and similar cases stay as source instead of losing content. Internal markers carry a per-page random value, so marker-like text in files or pasted content stays plain text. Tags wrapping only whitespace stay as source, and the lossless cache is kept per editor. Co-Authored-By: Claude Opus 5.5 <[email protected]>
randomUUID exists only in secure contexts, so Docs would fail to load when bb is opened over plain HTTP on a LAN address. getRandomValues works in every context. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The previous bound also timed jsdom building twenty thousand elements, which exceeded it on the Windows runner. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Collaborator
Changes from review (@brsbl)@alanagoyal's commit What changed after the original commit
Verification
Known limitations and follow-ups
BB-Thread-ID: thr_fashr87x6y
|
Collaborator
|
Thanks @alanagoyal! To review this in pieces, I moved it into a stack: #5442 (your commit, unchanged, with your description) → #5443 (HTML blocks) → #5444 (inline HTML). Squash-merging #5442 credits you as co-author. Closing this one as superseded; the comment above summarizes what changed. |
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.




Human comments
bug reported in discord: https://discord.com/channels/1522478522332090528/1558237749574766804
What was wrong
Editing a sentence in Docs could silently remove a video elsewhere in the document. The editor rendered raw HTML through Markdown, then parsed it into Tiptap’s supported nodes. Unsupported elements such as
<video>were dropped, and autosave wrote the incomplete document back to disk. A video with a fallback link became just the link; one without fallback text disappeared entirely.What changed
::htmlsandboxed previews still work.No Plugin SDK, CLI, or wire changes.
How you verified
pnpm exec turbo run test typecheck lint build --filter=bb-plugin-simple-notes: all 110 tests pass; typecheck and plugin build pass; lint has no errors and eight warnings in existing code.Verification used the real editor in jsdom; no manual desktop/browser smoke test was performed.