Asterisks surrounded by spaces are parsed as emphasis (`a * b * c` → `a <em> b </em> c`)
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 55/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- markdown, typescript
- Lĩnh vực
- content
Hướng nghiên cứu
Start by reproducing with renderHtml('a * b * c') from the @tanstack/markdown/html entry point. The fault is in how unescaped * delimiters are classified as left- or right-flanking when whitespace sits on both sides, so look at the inline emphasis delimiter handling in the parser that renderHtml calls. Done means both repro inputs render as literal asterisks, real italic still becomes emphasis, and escaped asterisks are unchanged.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Version: @tanstack/markdown 1.0.0 (renderHtml and the React adapter)
Repro
import { renderHtml } from '@tanstack/markdown/html'
renderHtml('5 * 4 * 3 = 60')
// actual: <p>5 <em> 4 </em> 3 = 60</p>
// expected: <p>5 * 4 * 3 = 60</p>
renderHtml('a * b * c')
// actual: <p>a <em> b </em> c</p>
// expected: <p>a * b * c</p>
Expected
Under CommonMark's delimiter-run rules, a * followed by whitespace is not left-flanking, so it can't open emphasis. A * preceded by whitespace is not right-flanking, so it can't close emphasis. Both delimiters here have whitespace on both sides, so the text should render literally.
Other parsers agree:
| Input | commonmark.js 0.31.2 | markdown-it 15.0.2 | micromark 4.0.3 | @tanstack/markdown 1.0.0 |
|---|---|---|---|---|
5 * 4 * 3 = 60 |
5 * 4 * 3 = 60 |
5 * 4 * 3 = 60 |
5 * 4 * 3 = 60 |
5 <em> 4 </em> 3 = 60 |
a * b * c |
a * b * c |
a * b * c |
a * b * c |
a <em> b </em> c |
*real italic* |
<em>real italic</em> |
<em>real italic</em> |
<em>real italic</em> |
<em>real italic</em> |
Why it matters
Arithmetic and multiplication in plain text (2 * 3, width * height) are common in user-written notes, and they silently turn into italics.
Escaped asterisks (5 \* 4 \* 3) render correctly. Only the flanking check on unescaped delimiters is affected.
- 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
-
Strong ending in nested emphasis (`**bold *italic***`) closes early and leaves a literal `*`Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
-
A blockquote with U+2028 or U+2029 loops the parser foreverCó thể đã có người làm @elwan-l1 đã nhận 21 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
Tất cả issue của TanStack/markdown
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
gnosis/gnosis_vpn#661 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
content-freshness: staleOwnedContent doc comments still say 'complete receipt' (follow-up to #7912)Đang mởtriage:bug-verified
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
Maintainer thường phản hồi trong vòng 1 ngày
-
fix: reject sourceStorage/packagedStorage bucket that differs from the stack default (fail loud)Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Eyevinn/open-videocore#1300 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
nextjs-tracking
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
cloudflare/vinext#4390 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
kind/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
kubernetes-sigs/headlamp#8175 ·
Maintainer thường phản hồi trong vòng 2 ngày