Use the Markdown syntax tree for inline formatting in markup mode
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 15/100
- Tipo di issue
- Refactoring
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- markdown, typescript
- Ambito
- frontend
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- TypeScript
- Stelle
- 428
- Fork
- 48
- Merge medio
- 5g 15h
- PR unite (30g)
- 47
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di gravity-ui/markdown-editor
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
gravity-ui/markdown-editor#1452 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
gravity-ui/markdown-editor#1293 ·
I maintainer di solito rispondono entro 1 giorno
-
Markup mode: `colorify` does not detect existing `{color}(...)` wrapper when switching colorsAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
gravity-ui/markdown-editor#1129 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 72/100
gravity-ui/markdown-editor#1450 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
gravity-ui/markdown-editor#1331 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di gravity-ui/markdown-editor
Issue simili
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster no-stale P2
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
openclaw/openclaw#199885 · 2 commenti · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
-
feature needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
BoardGamesEmpire/board-games-empire-backend#1306 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
sequant-io/sequant#1689 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100