Skip to content

Commit 904b0fc

Browse files
authored
Merge pull request #5391 from rtibbles/mo_accents_mo_problems
Add regression test for and fix use of accent property for mo tag.
2 parents 4aa3274 + fcd93ed commit 904b0fc

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

contentcuration/contentcuration/tests/utils/test_markdown.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,21 @@ def test_simple_block_math(self):
166166

167167
self._assert_conversion(markdown_text, expected)
168168

169+
def test_mo_accented(self):
170+
"""Regression test for missed experimental property on mo tags"""
171+
172+
markdown_text = "$$a_b+\\overrightarrow{abc}+\\overleftarrow{abc}\\div\\surd\\overline{abc}$$"
173+
expected = (
174+
'<math display="block">'
175+
"<semantics><mrow><msub><mi>a</mi><mi>b</mi></msub><mo>+</mo><mover><mrow><mi>a</mi><mi>b</mi><mi>c</mi></mrow><mo>→</mo></mover><mo>+</mo>"
176+
'<mover><mrow><mi>a</mi><mi>b</mi><mi>c</mi></mrow><mo>←</mo></mover><mi>÷</mi><mo stretchy="false">√</mo><mover><mrow><mi>a</mi><mi>b</mi>'
177+
'<mi>c</mi></mrow><mo accent="true">―</mo></mover></mrow>'
178+
'<annotation encoding="application/x-tex">a_b+\\overrightarrow{abc}+\\overleftarrow{abc}\\div\\surd\\overline{abc}</annotation></semantics>'
179+
"</math>"
180+
)
181+
182+
self._assert_conversion(markdown_text, expected)
183+
169184

170185
class TestTexMathPlugin(TexMathTestMixin, unittest.TestCase):
171186
"""Test direct markdown conversion: markdown → HTML+MathML"""

contentcuration/contentcuration/utils/assessment/qti/mathml/core.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ class Mn(MathMLTokenElement):
4545

4646

4747
class Mo(MathMLTokenElement):
48+
accent: Optional[bool] = None
4849
fence: Optional[bool] = None
4950
form: Optional[MathMLForm] = None
5051
largeop: Optional[bool] = None

0 commit comments

Comments
 (0)