Repository navigation
Publish QTI editor formulas as MathML - #6349
Open
rtibblesbot wants to merge 7 commits into
Open
rtibblesbot wants to merge 7 commits into
rtibblesbot wants to merge 7 commits into
Conversation
Rendered <math> now declares the MathML namespace, so converted items with formulas pass the item XSD. Renames _convert to latex_to_mathml. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
latex2mathml raises on malformed input such as `x_` or `{`, which
aborted the whole channel publish. The formula now renders as escaped
`$$latex$$` text and a warning is logged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The native QTI publish replaces each `span[data-latex]` the editor wrote with latex_to_mathml output, in prompts, choices and hints. Stored raw_data is left as the editor wrote it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A `span[data-latex]` used to unwrap to its empty content, so the formula vanished. It now derives as `$$latex$$`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Restore keeps the packaged MathML, which the editor loads as formulas. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A line opening with $$…$$ was parsed as block math, dropping the rest of the line (`$$5$$ exactly` lost "exactly"). Block math now needs the formula to end its line. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Converted legacy items carry formulas as MathML, which TipTap flattened to text, MathML and LaTeX run together, so saving an edit destroyed them. The Math node now parses MathML with a TeX annotation. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
rtibblesbot
force-pushed
the
issue-6327-cced4e
branch
from
October 28, 2026 01:51
6b8ce87 to
86f1e95
Compare
rtibblesbot
marked this pull request as ready for review
October 28, 2026 01:55
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
$$latex$$).$$…$$formulas open as editor formulas.$$latex$$instead of aborting.References
Fixes #6327. Related: #6347.
Reviewer guidance
Suggested review: Full code review, then manual QA once the reviewer sets Needs QA.
contentcuration/contentcuration/frontend/shared/views/TipTapEditor/TipTapEditor/extensions/Math.js,contentcuration/contentcuration/frontend/shared/views/TipTapEditor/TipTapEditor/utils/comparisonKey.js.<math>carrying anapplication/x-texannotation as an editable formula, so saving a converted legacy, restored or ricecooker item rewrites its MathML asdata-latexspans that publish inline, block formulas included.$$…$$followed by text now converts inline and keeps that text, and\text{}holding<or&now converts instead of failing.develop(QTI) and an older Kolibri (Perseus), then restore the channel and reopen the question in the editor.Open questions:
<math>with a TeX annotation, so republish regenerates ricecooker MathML — acceptable?$$x_$$) becomes editable QTI text instead of staying legacy — acceptable?QA (riskiest: reopen, publish). Requires: a new Studio channel and a Kolibri
developbuild.a<b&conce.$$…$$formulas in the question, answers and hints.Look out for:
Evidence
Legacy
$$…$$formulas in preview and editorAfter: not captured (stale QA bundle).
Unconvertible legacy LaTeX
$$…$$sources2-unconvertible-latex-edit-save.webm
Math tool formulas survive save and reload
x/y,1+1and following text intacts3-reopen-formulas-after-reload.webm
<,&,\fracand malformed formulasa<b&c,½, bothx_and following text intactMixed legacy + QTI channel publish
s5-publish-mixed-channel.webm
More captures (16)
$$…$$textx^2+1x_in the math dialogAI usage
Claude Code wrote the implementation and tests. Verified with the assessment utils and restore suites and pre-commit; no Kolibri import run.
Written by rtibblesbot, an LLM-based coding agent.
🟡 Waiting for feedback
Last updated: 2026-10-28 01:55 UTC