Bug Description
When using ** bold markers immediately followed by quotation marks (both straight " and curly "), the markdown parser fails to recognize the bold syntax.
Test Case
Input markdown:
效果**如何**?
我发现**"黑体"**展示不准确。
我发现**"黑体"**展示不准确。
我发现"**黑体**"展示不准确。
Expected Output
All four cases should render with bold text:
效果**如何**? → <strong>如何</strong> ✅
**"黑体"** → <strong>"黑体"</strong> ❌ (actual: **"黑体"**)
**"黑体"** → <strong>"黑体"</strong> ❌ (actual: **"黑体"**)
"**黑体**" → <strong>黑体</strong> ✅
Actual Output
<p>效果<strong>如何</strong>?</p>
<p>我发现**"黑体"**展示不准确。</p>
<p>我发现**"黑体"**展示不准确。</p>
<p>我发现"<strong>黑体</strong>"展示不准确。</p>
Root Cause
This is a limitation of the marked.js library used by wenyan. The parser requires certain boundary characters around the ** delimiters to recognize them as emphasis markers. When ** is immediately followed by a quotation mark, the parser doesn't recognize it as a valid emphasis boundary.
Environment
- wenyan-cli version: (current)
- Node.js version: N/A
- OS: macOS
Possible Solutions
- Configure
marked.js to be more permissive with emphasis boundaries
- Add a preprocessing step to handle this edge case
- Document this limitation and recommend users write
"**text**" instead of **"text"**
Reference
- Test file used:
/tmp/wenyan-theme-normal.md
Bug Description
When using
**bold markers immediately followed by quotation marks (both straight"and curly"), the markdown parser fails to recognize the bold syntax.Test Case
Input markdown:
Expected Output
All four cases should render with bold text:
效果**如何**?→<strong>如何</strong>✅**"黑体"**→<strong>"黑体"</strong>❌ (actual:**"黑体"**)**"黑体"**→<strong>"黑体"</strong>❌ (actual:**"黑体"**)"**黑体**"→<strong>黑体</strong>✅Actual Output
Root Cause
This is a limitation of the
marked.jslibrary used by wenyan. The parser requires certain boundary characters around the**delimiters to recognize them as emphasis markers. When**is immediately followed by a quotation mark, the parser doesn't recognize it as a valid emphasis boundary.Environment
Possible Solutions
marked.jsto be more permissive with emphasis boundaries"**text**"instead of**"text"**Reference
/tmp/wenyan-theme-normal.md