Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

[RTE] Toolbar Copy should copy the selection's serialized content, not its DOM

Abierto
#6,296 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
45/100
Tipo de issue
Refactorización
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
javascript
Área
frontend

Línea de trabajo

Start at handleCopy in contentcuration/contentcuration/frontend/shared/views/TipTapEditor/TipTapEditor/composables/useToolbarActions.js (L113-L186), which clones the selection DOM today; replace it with editor.view.serializeForClipboard(selection.content()). Then remove the math-field special case there and the hidden copySource span in TipTapEditor node views like InlineChoiceChip/index.vue. Done means Toolbar Copy and Ctrl+C emit identical text/html, plus unit tests covering copy of a formula and a chip. Note the issue header states it is not open for contribution yet.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

DEV: frontend

❌ This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues.

Overview

The rich text editor's toolbar Copy button builds its HTML by cloning the selection's DOM, so every node view that holds data must special-case itself to copy correctly. Copy should produce the same HTML as ProseMirror's own clipboard serializer, the one Ctrl+C uses.

Complexity: Low
Target branch: unstable

Context
  • handleCopy clones window.getSelection()'s range and patches it: <math-field> becomes a math-inline span, data-copy-ignore elements and Vue attributes are stripped, math-node-wrapper divs are unwrapped (useToolbarActions.js#L113-L186).
  • The inline choice chip in #6277 keeps a hidden copySource span holding its own renderHTML output only so this Copy picks it up (InlineChoiceChip/index.vue).
  • Raised in review of #6277.
The Change

Toolbar Copy should write the HTML ProseMirror serializes for the selection (editor.view.serializeForClipboard(selection.content())), so a node view's DOM no longer decides what is copied.

Acceptance Criteria
  • Toolbar Copy then paste of a selection containing a formula reproduces the formula.
  • Toolbar Copy then paste of a selection containing an inline choice chip reproduces the chip with its options and correct answer.
  • The math-field special case in handleCopy is gone.
  • The inline choice chip's hidden copySource span is gone.
  • Toolbar Copy and Ctrl+C put the same text/html on the clipboard for the same selection.
  • Unit tests cover toolbar Copy of a selection with a formula and with a chip.

AI usage

A reviewer asked for this follow-up on #6277; Claude Code drafted it from that review thread and the current handleCopy code.

Lenguaje dominante
Python
Estrellas
191
Forks
308
Merge medio
2 d 17 h
PR fusionados (30 d)
64

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de learningequality/studio

Todos los issues de learningequality/studio

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.