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

Observed behavior
- A QTI item whose prompt carries MathML under a prefix (
xmlns:m on the root, <m:math> in the prompt) loses the formula on its first save from the editor. Only its text survives.
- Source prompt:
<qti-prompt>solve <m:math><m:mi>x</m:mi><m:mo>+</m:mo><m:mn>1</m:mn></m:math>.</qti-prompt>
- Saved prompt after typing at the end:
<qti-prompt><p>solve x+1. Edited</p></qti-prompt>
adoptNode re-creates foreign elements with createElementNS(namespace, node.tagName), so the HTML handed to TipTap contains <m:math>, which TipTap does not recognise as math.
Expected behavior
- The formula in the prompt survives the edit.
User-facing consequences
- Imported items that use prefixed MathML silently lose their formulas the first time anyone edits the question text, and publish without them.
Steps to reproduce
- Seed an exercise with a QTI item whose root declares
xmlns:m="http://www.w3.org/1998/Math/MathML" and whose single-choice prompt contains <m:math>…</m:math>.
- Open the exercise's Questions tab, click "Edit" on the item, type at the end of the question text, click "Close".
- Read the saved
raw_data: the <m:math> element is gone.
Seen on unstable at 90c5b61, during manual QA for #6290.
Acceptance Criteria
AI usage
Claude Code found this during manual QA of #6290 and drafted the issue.
❌ This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues.
Observed behavior
xmlns:mon the root,<m:math>in the prompt) loses the formula on its first save from the editor. Only its text survives.<qti-prompt>solve <m:math><m:mi>x</m:mi><m:mo>+</m:mo><m:mn>1</m:mn></m:math>.</qti-prompt><qti-prompt><p>solve x+1. Edited</p></qti-prompt>adoptNodere-creates foreign elements withcreateElementNS(namespace, node.tagName), so the HTML handed to TipTap contains<m:math>, which TipTap does not recognise as math.Expected behavior
User-facing consequences
Steps to reproduce
xmlns:m="http://www.w3.org/1998/Math/MathML"and whose single-choice prompt contains<m:math>…</m:math>.raw_data: the<m:math>element is gone.Seen on
unstableat 90c5b61, during manual QA for #6290.Acceptance Criteria
<m:math>(prefixed MathML) saves a prompt that still contains the formula as MathML.raw_data.AI usage
Claude Code found this during manual QA of #6290 and drafted the issue.