Emphasis closer is found inside code spans and inline parser ranges
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 68/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- typescript
調査の方向性
Start in src/inline.ts, reading parseInline and findDelimiter to understand how emphasis closers are found and how inline parsers and code spans are handled. Reproduce the three cases from the issue, then verify that links and code spans inside emphasis are parsed intact and run the relevant existing inline parser tests.
索引モデルが issue の本文から書いたものです。
説明
Problem
When parseInline reads an emphasis opener (*, _ or ~), findDelimiter in src/inline.ts scans the raw text for the closer. The scan does not skip text that binds more tightly than emphasis, so it can find a closer inside:
- a range that an
inlineParserextension consumes, for example a link fromautolinksExtension() - a code span
CommonMark gives code spans and autolinks a higher precedence than emphasis (spec 6.1). Without an opener before them, the same links parse correctly, because the inline parser runs first.
Reproduction
@tanstack/markdown 1.2.0:
import { parseInline } from '@tanstack/markdown'
import { autolinksExtension } from '@tanstack/markdown/extensions/autolinks'
const extensions = [autolinksExtension()]
parseInline('_see https://faceit.com/players/_Santiago_ now_', { extensions })
// emphasis: "see " + link https://faceit.com/players/_Santiago (wrong URL)
// text: " now_"
parseInline('*see https://example.com/*x*/y*', { extensions })
// emphasis: "see " + link https://example.com/
// text: "x", emphasis: "/y"
parseInline('*a `*` b*')
// emphasis: "a `", text: "` b*" (no code span)
Expected
_see https://faceit.com/players/_Santiago_ now_: emphasis that contains a link tohttps://faceit.com/players/_Santiago_*see https://example.com/*x*/y*: emphasis that contains a link tohttps://example.com/*x*/y*a `*` b*: emphasis that contains a code span with*
Possible fix
In findDelimiter, skip code spans as the main loop does. At a character that is in an inline parser's markers, call the parser and skip result.length characters when it matches. This makes the parser run twice for the same range, so the docs would need to say that parse must not have side effects.
Written by an agent (Claude Code, claude-opus-5-5).
- 主要言語
- TypeScript
- スター
- 433
- フォーク
- 12
- 平均マージ
- 29分
- マージ済み PR(30日)
- 7
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
TanStack/markdown のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
-
難易度 3/5 半日 初心者へのやさしさ 70/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
TanStack/markdown の issue をすべて見る
似ている issue
-
Type/Improvement
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
OpenNSW/nsw-srilanka#1259 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
oxc-project/tsrs#1010 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
Fission-AI/OpenSpec#2260 ·
メンテナーはふだん 1 日以内に返信
-
Add: ESP 1 UKオープンcheck:passed streams:add
難易度 1/5 1〜3時間 初心者へのやさしさ 64/100
メンテナーはふだん 1 日以内に返信
-
area:infra area:storage bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
THU-MAIC/OpenMAIC#2311 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信