Repository navigation
fix(id): carry emphasis/strong/strikethrough marks wrapping images through the markdown codec (#1407) - #1630
Conversation
…rough the markdown codec (#1407)
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 19 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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. |
Fixes #1407.
Approach (follows the #880 attr precedent)
convert_nodeImage arm): emphasis/strong/strikethrough found inactive_marksnow ride on the image node as amarksarray — the same shape text nodes use. The link keeps its existinglinkHref/linkTitleattrs (id(web): linked images [](href) lose their link in the markdown ↔ ProseMirror codec — save strips the href #880 unchanged, combined forms keep working).json_to_astimage case): the old link-only wrap is generalized to a full mark chain —linkHrefplus themarksarray — built in canonical nesting order (id(web): bold links flip spelling on every save — strong+link marks have no round-trip fixpoint #944, same ascreate_marked_text) viabuild_mark_chain. The chain flows throughappend_inline_child's mark merging (id(web): nested marks corrupt on save — em/strike/code inside strong/em gain   entities and multiplied delimiters, several non-fixpoint #968), so a marked image inside a marked text span rejoins the one span instead of fragmenting it, and no boundary entities leak.<img>emit) are unchanged: marks apply to the markdown-image form only.Combined spelling note: canonical nesting puts the link outermost, so
*[](href)*saves as[**](href)— the same canonicalization the codec already applies to marked text — and re-parses to the identical node (fixpoint tested).Editor note: no
editor.tschange — the representation is codec-side (markson the image node, mirroring text nodes); the editor schema does not wrap image nodes in marks today, the known limitation the #880 precedent already documents for links.Tests
New codec regression tests: image-only spans for
*,**,~~in both directions with fixpoint; combined marked+linked image; mixed*text  tail*saving as one span with no .Verified on the laptop:
cargo test --features web --lib web::markdown— 103 passed, 0 failed. Full suite runs in CI on this PR (fleet CI-first policy).Queue task 1477.
Need help on this PR? Tag
@codesmith-botwith what you need.