Use the Markdown syntax tree for inline formatting in markup mode
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 15/100
- Tipo de issue
- Refactorización
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Stack tecnológico
- markdown, typescript
- Área
- frontend
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- TypeScript
- Estrellas
- 428
- Forks
- 48
- Merge medio
- 5 d 15 h
- PR fusionados (30 d)
- 47
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de gravity-ui/markdown-editor
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
gravity-ui/markdown-editor#1452 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
gravity-ui/markdown-editor#1293 ·
Los mantenedores suelen responder en 1 día
-
Markup mode: `colorify` does not detect existing `{color}(...)` wrapper when switching colorsAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
gravity-ui/markdown-editor#1129 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 3/5 1-2 días Aptitud para principiantes 72/100
gravity-ui/markdown-editor#1450 ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
gravity-ui/markdown-editor#1331 ·
Los mantenedores suelen responder en 1 día
Todos los issues de gravity-ui/markdown-editor
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
tintinweb/pi-subagents#459 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
danielmiessler/LifeOS#2830 ·
Los mantenedores suelen responder en 6 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
freshframework/fresh#3920 ·
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
area: client enhancement priority: low
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
opensro-dev/opensro#3681 ·
Los mantenedores suelen responder en 1 día