Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Asterisks surrounded by spaces are parsed as emphasis (`a * b * c` → `a <em> b </em> c`)

Đang mở
#28 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

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

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của TanStack/markdown

Tất cả issue của TanStack/markdown

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.