chore(x-markdown-deps): bump marked from 15.x to 16.x - #1969
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthrough将 x-markdown 的 marked 依赖升级到 ^16.2.1,更新 Jest 模块转换范围,并新增流式渲染测试,验证引用定义结尾时 tail 仍挂载在最后可见文本段落中。 Changesmarked 依赖升级与测试验证
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested labels: Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Code Review
This pull request upgrades the marked dependency from ^15.0.12 to ^16.2.1 in packages/x-markdown, which updates snapshot tests for the LaTeX plugin and introduces a new test case to ensure the streaming tail renders correctly when content ends with a reference definition. The reviewer suggested improving the robustness of this new test case by asserting that paragraph elements exist before accessing them, preventing potential unhandled TypeError exceptions during test failures.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| const paragraphs = container.querySelectorAll('p'); | ||
| const lastParagraph = paragraphs[paragraphs.length - 1]; | ||
| const tailElement = lastParagraph.querySelector('.xmd-tail'); | ||
| expect(tailElement).toBeInTheDocument(); |
There was a problem hiding this comment.
在测试中,如果 paragraphs 为空,paragraphs[paragraphs.length - 1] 将会是 undefined,这会导致 lastParagraph.querySelector 抛出 TypeError 异常,从而掩盖了实际的测试断言失败。建议先断言 paragraphs 存在且长度大于 0,或者使用可选链(optional chaining)来提高测试的健壮性,使测试失败时的错误信息更加清晰。
const paragraphs = container.querySelectorAll('p');
expect(paragraphs.length).toBeGreaterThan(0);
const lastParagraph = paragraphs[paragraphs.length - 1];
const tailElement = lastParagraph?.querySelector('.xmd-tail');
expect(tailElement).toBeInTheDocument();
Bundle ReportChanges will increase total bundle size by 8 bytes (0.0%) ⬆️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: antdx-array-pushAssets Changed:
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1969 +/- ##
=======================================
Coverage 97.06% 97.06%
=======================================
Files 159 159
Lines 5766 5766
Branches 1712 1710 -2
=======================================
Hits 5597 5597
Misses 167 167
Partials 2 2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
@waiter marked 15.x --> 16.x 会有 breaking change 嘛? |
@Div627 有打包相关的 breaking change : https://github.com/markedjs/marked/releases/tag/v16.0.0 |


中文版模板 / Chinese template
🤔 This is a ...
🔗 Related Issues
无
💡 Background and Solution
由于 x 依赖了 mermaid ,而 mermaid 又依赖 marked 16.x ,但是当前 x-markdown 依赖的 marked 是 15.x ,所以在同时使用 两者时,marked 会被打包 2 次
📝 Change Log
Summary by CodeRabbit
[foo]: ...),尾部仍会正确附加到最后一个可见文本段落内。.xmd-tail。