Skip to content

.414989552471815:001f0510c2f6ad34cacd3278f3cd829c_69eb2aaf286388925d723dad.69ec7c21a2b89670a7d71a75.69ec7c212ecaed5b58d9be71:Trae CN.T(2026/4/25 16:32:34)#3958

Closed
zilvya wants to merge 2 commits intomarkedjs:masterfrom
zilvya:a2

Conversation

@zilvya
Copy link
Copy Markdown

@zilvya zilvya commented Apr 25, 2026

Marked version:

Markdown flavor: Markdown.pl|CommonMark|GitHub Flavored Markdown|n/a

Description

  • Fixes #### (if fixing a known issue; otherwise, describe issue using the following format)

Contributor

  • Test(s) exist to ensure functionality and minimize regression (if no tests added, list tests covering this PR); or,
  • no tests required for this PR.
  • If submitting new feature, it has been documented in the appropriate places.

Committer

In most cases, this should be a different person than the contributor.

zilvya added 2 commits April 25, 2026 16:29
添加对空块引用的处理,当块引用内容仅为空白字符时跳过解析
新增测试用例验证空块引用场景
该测试文件已不再需要,因为相关功能测试已迁移至其他测试套件中
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 25, 2026

@zilvya is attempting to deploy a commit to the MarkedJS Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/Tokenizer.ts
Comment on lines +224 to +227
// Skip empty blockquotes (only whitespace content)
if (!text.trim()) {
return;
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

This change breaks standard Markdown behavior and introduces a potential runtime crash.

  1. 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 returning undefined, this code causes them to be misparsed as plain text or paragraphs.
  2. Stability Issue: The blockquote method is called recursively at line 204 using a non-null assertion (!). If a nested blockquote is empty, this new check will cause this.blockquote() to return undefined, leading to a crash when accessing newToken.raw at line 207.

It is recommended to remove this check.

@UziTech
Copy link
Copy Markdown
Member

UziTech commented Apr 25, 2026

This seems like a duplicate of #3957

@UziTech UziTech closed this Apr 25, 2026
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.

2 participants