[RTE] Toolbar Copy should copy the selection's serialized content, not its DOM
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
- Issue type
- Refactor
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- javascript
- Domain
- frontend
Research direction
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.
Written by the indexing model from the issue text.
Description
❌ 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
handleCopycloneswindow.getSelection()'s range and patches it:<math-field>becomes amath-inlinespan,data-copy-ignoreelements and Vue attributes are stripped,math-node-wrapperdivs are unwrapped (useToolbarActions.js#L113-L186).- The inline choice chip in #6277 keeps a hidden
copySourcespan holding its ownrenderHTMLoutput 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-fieldspecial case inhandleCopyis gone. - The inline choice chip's hidden
copySourcespan is gone. - Toolbar Copy and Ctrl+C put the same
text/htmlon 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.
- Dominant language
- Python
- Stars
- 191
- Forks
- 308
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 57
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from learningequality/studio
-
DEV: frontend P3 - low
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
learningequality/studio#5868 ·
Maintainers usually reply within 1 day
-
TAG: tech update / debt
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
learningequality/studio#2245 ·
Maintainers usually reply within 1 day
-
bug DEV: backend
Difficulty 3/5 Half a day Newbie friendliness 35/100
learningequality/studio#6294 ·
Maintainers usually reply within 1 day
-
DEV: frontend P1 - important TAG: a11y
Difficulty 2/5 1-3 hours Newbie friendliness 28/100
learningequality/studio#6292 ·
Maintainers usually reply within 1 day
-
[QTI] Editing a question keeps the item-level content the editor doesn't writePossibly taken @rtibblesbot claimed this 1 day ago. Openbug
Difficulty 3/5 1-2 days Newbie friendliness 55/100
learningequality/studio#6290 · 1 reaction · 1 assignee ·
Maintainers usually reply within 1 day
All issues in learningequality/studio
Similar issues
-
Difficulty 1/5 1-3 hours Newbie friendliness 85/100
pytest-dev/pluggy#757 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 1-3 hours Newbie friendliness 85/100
NousResearch/hermes-agent#134960 ·
Maintainers usually reply within 1 day
-
HTML backend: `<br>` leaks the internal sentinel U+E000 into list items, headings and captionsPossibly taken @morten-lagabote claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
docling-project/docling#4671 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Maintainers usually reply within 1 day
-
good first issue hacktoberfest infra
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day