Skip to content

fix(id): pin documented skip policy for unknown marks (#1045) - #4685

Merged
dezren39 merged 1 commit into
mainfrom
queue/6632-1045-unknown-mark-policy
Nov 3, 2026
Merged

dezren39 merged 1 commit into
mainfrom
queue/6632-1045-unknown-mark-policy

Conversation

@dezren39

@dezren39 dezren39 commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

Follow-up to #1045 triage (task 6632).

Unknown marks are now an explicitly documented skip-by-design policy on prosemirror_to_markdown (text survives, unknown styling is shed), distinct from unknown nodes which keep returning ConversionError::UnknownType.

  • Doc comment on prosemirror_to_markdown naming the policy
  • Clarified skip arm in create_marked_text (code vs unknown marks)
  • Regression test test_unknown_marks_are_skipped_by_design: bare unknown mark, mixed known+unknown, code+link+unknown

Tests: cargo test --offline --features web --lib web::markdown — 224 passed, 0 failed (stub web/dist, gitignored, required for rust-embed compile).

Closes #1045.


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

Summary by CodeRabbit

  • Bug Fixes
    • Markdown conversion now preserves text when it has unrecognized formatting, while continuing to render supported formatting.

Unknown marks are shed by design while their text survives; unknown
nodes keep returning ConversionError::UnknownType. Documents the
policy on prosemirror_to_markdown, clarifies the skip arm in
create_marked_text, and adds a regression test covering bare,
mixed known+unknown, and code+link+unknown mark combinations.
@dezren39
dezren39 requested a review from a team as a code owner November 3, 2026 00:34
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-03T00:35:48.721216Z 1b5d79e PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 5fc2d31d-169f-4e74-9aa1-1963f9b90532
Commits

Reviewing files that changed from the base of the PR and between 11562fc and 1b5d79e.

Files selected for processing: 1
  • pkgs/id/src/web/markdown.rs

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Walkthrough

The pull request documents that unknown marks are skipped while their text remains. It adds a regression test for unknown marks alone and alongside recognized marks, including code and links.

Changes: Unknown Mark Policy

Layer / File(s) Summary
Document and test unknown-mark policy
pkgs/id/src/web/markdown.rs
The API documentation and fallback comment describe how unknown marks are handled. A regression test checks text preservation and rendering with recognized marks.

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix · Severity of issue fixed: Medium

Possibly related PRs

  • developing-today/code#985: Defines canonical ordering for incoming marks, including unrecognized marks, which share the unknown-mark handling path changed here.
Merge Risk: Minimal · up to 1b5d7

The change documents and tests the existing unknown-mark skip policy. No merge-blocking risk is identified; merge after normal checks pass.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the fix area (id) and the policy being pinned (skip policy for unknown marks), which matches the changeset. It also cites issue #1045 in the title. The title is a single sentence, but …
Linked Issues check Passed Issue #1045 requires a documented and tested policy for unknown marks. The diff adds a prosemirror_to_markdown doc comment that names the skip-by-design policy and distinguishes unknown marks from u…
Out of Scope Changes check Passed The diff changes only pkgs/id/src/web/markdown.rs. It adds issue-focused documentation, clarifies existing unknown-mark handling, and adds regression coverage for issue #1045. No unrelated implement…
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Full details: Title check

Explanation

The title names the fix area (id) and the policy being pinned (skip policy for unknown marks), which matches the changeset. It also cites issue #1045 in the title. The title is a single sentence, but it does not name the behavior as a skip. Its wording of 'pin documented skip policy' is specific enough for a teammate scanning history to see the main change: unknown marks are now skipped in prosemirror_to_markdown, with tests and a doc comment added.

Full details: Linked Issues check

Explanation

Issue #1045 requires a documented and tested policy for unknown marks. The diff adds a prosemirror_to_markdown doc comment that names the skip-by-design policy and distinguishes unknown marks from unknown nodes. The create_marked_text comment separates code handling from unknown-mark skipping. The new regression test covers a bare unknown mark, mixed known and unknown marks, and code plus link plus an unknown mark. The reported web::markdown test run passed with 224 tests, and the test cases preserve known-mark and code output.

Full details: Out of Scope Changes check

Explanation

The diff changes only pkgs/id/src/web/markdown.rs. It adds issue-focused documentation, clarifies existing unknown-mark handling, and adds regression coverage for issue #1045. No unrelated implementation or test changes are present.

Full details: Docstring Coverage

Explanation

Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 2 functions across 1 files.

Finishing Touches
Generate docstrings
  • Commit to this branch
  • Create a new PR
Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

id(web): unknown marks are silently dropped on save while unknown nodes error — pick and pin a policy

1 participant