Use the Markdown syntax tree for inline formatting in markup mode
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 15/100
- issue の種類
- リファクタリング
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- markdown, typescript
- 領域
- frontend
調査の方向性
The issue asks to replace the text-splitting inline formatting logic in markup mode with ranges built from the Markdown syntax tree, using ensureSyntaxTree from @codemirror/language. Read the current formatting command code and the Markdown language setup first, then check linked pull request #1313 before starting. Done means every listed block type and command keeps its markers intact, with tests for each case and for undo and redo.
索引モデルが issue の本文から書いたものです。
説明
Inline formatting currently splits selections at blank lines and checks markers at range edges. It does not use the Markdown structure.
This can place formatting markers around block syntax, mix markers from separate elements, or produce invalid Markdown.
Examples:
- List markers become part of bold or italic text.
- Heading markers lose their meaning.
- A selection across table cells can wrap table separators.
- Code content can receive formatting markers as literal text.
- Existing nested formatting can be detected incorrectly.
Proposed solution:
Use ensureSyntaxTree from @codemirror/language to read the existing Markdown syntax tree and build formatting ranges from syntax nodes.
Expected behavior:
- Format text in each paragraph, list item, heading, or table cell separately.
- Keep list markers, heading markers, quote prefixes, table separators, and code fences intact.
- Support nested blocks, task lists, and multiline text.
- Define handling for inline code, fenced code, and indented code. Formatting must not silently change literal code content.
- Check which YFM blocks the existing parser supports and define a fallback for unsupported syntax.
- Use syntax nodes to detect existing formatting where possible.
- Preserve partial selections, selection direction, multiple selections, and cursor placement.
- Keep formatting markers selected so users can apply several styles in sequence.
- Apply each command as one undoable transaction.
- Do not apply changes based on an incomplete syntax tree.
Apply the shared range logic to text styles, text color, inline math, and inline code. Keep command-specific rules where needed.
Add tests for each block type, mixed selections across blocks, nested formatting, consecutive commands, undo, and redo. Test states must use the same Markdown language configuration as the editor.
- 主要言語
- TypeScript
- スター
- 428
- フォーク
- 48
- 平均マージ
- 5日 15時間
- マージ済み PR(30日)
- 47
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
gravity-ui/markdown-editor のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
gravity-ui/markdown-editor#1452 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
gravity-ui/markdown-editor#1293 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
gravity-ui/markdown-editor#1129 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 72/100
gravity-ui/markdown-editor#1450 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
gravity-ui/markdown-editor#1331 ·
メンテナーはふだん 1 日以内に返信
gravity-ui/markdown-editor の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
tintinweb/pi-subagents#459 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
danielmiessler/LifeOS#2830 ·
メンテナーはふだん 6 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
freshframework/fresh#3920 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
area: client enhancement priority: low
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
opensro-dev/opensro#3681 ·
メンテナーはふだん 1 日以内に返信