Strong ending in nested emphasis (`**bold *italic***`) closes early and leaves a literal `*`
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 48/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- markdown, typescript
- Lĩnh vực
- backend
Hướng nghiên cứu
Start at the Markdown emphasis parsing entry point and its tests; the issue does not name specific files, so first locate how delimiter runs are matched. Reproduce the nested and flanking cases from the report and compare output with micromark 4.0.2. Done means all listed inputs produce the expected CommonMark HTML, including the already working reverse nesting case.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
When a strong span ends with a nested emphasis span, so that the closing run is ***, @tanstack/markdown closes the <strong> early and leaves a literal * behind. The reverse case (*outer **inner***) already works.
This is common in real content. MDXEditor's Markdown serializer, for example, writes bold text ending in an italic title exactly as **25 years of *Title***, so content produced by that editor renders with stray asterisks.
Environment
@tanstack/markdown1.0.0,renderHtmlfrom@tanstack/markdown/html. The React adapter shows the same output.- Node 24
- Reference:
micromark4.0.2 (CommonMark)
Reproduction
import { renderHtml } from '@tanstack/markdown/html'
renderHtml('**bold *italic***')
renderHtml('**25 years of *Title***, the debut album.')
renderHtml('***Iceman*, *Maid of Honour* and *Habibti***')
| Input | @tanstack/markdown 1.0.0 |
micromark 4.0.2 (expected) |
|---|---|---|
**bold *italic*** |
<p><strong>bold *italic</strong>*</p> |
<p><strong>bold <em>italic</em></strong></p> |
**25 years of *Title***, the debut album. |
<p><strong>25 years of *Title</strong>*, the debut album.</p> |
<p><strong>25 years of <em>Title</em></strong>, the debut album.</p> |
***Iceman*, *Maid of Honour* and *Habibti*** |
<p><em><strong>Iceman<em>, </em>Maid of Honour<em> and </em>Habibti</strong></em></p> |
<p><strong><em>Iceman</em>, <em>Maid of Honour</em> and <em>Habibti</em></strong></p> |
*outer **inner*** (works) |
<p><em>outer <strong>inner</strong></em></p> |
same |
Related flanking cases (in addition to #28)
#28 covers a * with whitespace on both sides. These two variants also open or close where CommonMark does not:
| Input | @tanstack/markdown 1.0.0 |
micromark 4.0.2 (expected) |
|---|---|---|
**VIP pass **: entry included |
<p><strong>VIP pass </strong>: entry included</p> |
<p>**VIP pass **: entry included</p> |
Seats CSI5* and CSI1*, both sold |
<p>Seats CSI5<em> and CSI1</em>, both sold</p> |
<p>Seats CSI5* and CSI1*, both sold</p> |
- First row: the closing
**is preceded by whitespace, so it is not right-flanking. - Second row: the first
*is followed by whitespace, so it is not left-flanking.
Context
We compared @tanstack/markdown against a corpus of about 4,000 real Markdown documents. These emphasis cases account for most of the visible differences. They are the only thing blocking us from adopting it.
- Ngôn ngữ chính
- TypeScript
- Star
- 432
- Fork
- 11
- Merge trung bình
- 57 phút
- Pull request đã merge (30 ngày)
- 4
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của TanStack/markdown
-
A blockquote with U+2028 or U+2029 loops the parser foreverCó thể đã có người làm @elwan-l1 đã nhận 20 ngày trước. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 62/100
-
Độ khó 3/5 Nửa ngày Mức phù hợp với người mới 70/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
Tất cả issue của TanStack/markdown
Issue tương tự
-
category::task code priority::normal
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
e0ipso/strikethroo#145 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 85/100
cocos/cocos-docs#3333 ·
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
RevenueCat/react-native-purchases#2079 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
RevenueCat/purchases-hybrid-common#2039 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
agent-reported area/react bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày