Repository navigation
Preserve HTML embeds when editing Docs - #5442
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d63b669c22
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| parse: { | ||
| setup(markdown) { | ||
| markdown.renderer.rules.html_block = (tokens, index) => { | ||
| const source = tokens[index]!.content; |
There was a problem hiding this comment.
Protect raw blocks before preview rewriting
When an HTML block contains a line matching ::html{...} or Markdown image syntax—for example inside a <pre>, script, or video fallback—displayMarkdown() rewrites that text before this renderer receives it, so source is already corrupted and the next autosave persists the generated embed markup or a normalized image path. Extract or mask raw HTML before applying the preview transformations so an unrelated rich-editor change actually preserves the block byte-for-byte.
Useful? React with 👍 / 👎.
How this stack changes Alana's commitAlana's commit BB-Thread-ID: thr_fashr87x6y
|
d63b669 to
eca1632
Compare
eca1632 to
275570a
Compare
275570a to
b3fb8a6
Compare
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.