.414989552471815:001f0510c2f6ad34cacd3278f3cd829c_69eb2aaf286388925d723dad.69ec7c21a2b89670a7d71a75.69ec7c212ecaed5b58d9be71:Trae CN.T(2026/4/25 16:32:34)#3958
Conversation
添加对空块引用的处理,当块引用内容仅为空白字符时跳过解析 新增测试用例验证空块引用场景
该测试文件已不再需要,因为相关功能测试已迁移至其他测试套件中
|
@zilvya is attempting to deploy a commit to the MarkedJS Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
Code Review
This pull request modifies the blockquote tokenization logic in src/Tokenizer.ts to skip elements containing only whitespace. Review feedback indicates that this change violates Markdown specification compliance for empty blockquotes and introduces a potential runtime crash due to recursive calls expecting a valid token object. It is recommended to revert this change to maintain stability and spec adherence.
| // Skip empty blockquotes (only whitespace content) | ||
| if (!text.trim()) { | ||
| return; | ||
| } |
There was a problem hiding this comment.
This change breaks standard Markdown behavior and introduces a potential runtime crash.
- Spec Compliance: Empty blockquotes (e.g., a single
>on a line) are valid in CommonMark and GFM. They should produce an empty<blockquote>element. By returningundefined, this code causes them to be misparsed as plain text or paragraphs. - Stability Issue: The
blockquotemethod is called recursively at line 204 using a non-null assertion (!). If a nested blockquote is empty, this new check will causethis.blockquote()to returnundefined, leading to a crash when accessingnewToken.rawat line 207.
It is recommended to remove this check.
|
This seems like a duplicate of #3957 |
Marked version:
Markdown flavor: Markdown.pl|CommonMark|GitHub Flavored Markdown|n/a
Description
Contributor
Committer
In most cases, this should be a different person than the contributor.