From bb2155b95813204485fe38becf388e4ba2f72bfe Mon Sep 17 00:00:00 2001 From: Prashanth Jaganathan Date: Wed, 7 Jan 2026 20:30:47 -0500 Subject: [PATCH] Fix XML syntax error in groupChrPr closing tags --- mathml2omml/__init__.py | 4 ++-- tests/test_converter.py | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/mathml2omml/__init__.py b/mathml2omml/__init__.py index f9bcde4..122f5d2 100644 --- a/mathml2omml/__init__.py +++ b/mathml2omml/__init__.py @@ -747,7 +747,7 @@ def to_str(self): '' '' '' - '' + '' '%s' '') % (underscript.escape_text(), base) return ('' @@ -784,7 +784,7 @@ def to_str(self): '' '' '' - '' + '' '%s' '') % (overscript.escape_text(), base) return ('' diff --git a/tests/test_converter.py b/tests/test_converter.py index 3a2140f..cd5d11b 100644 --- a/tests/test_converter.py +++ b/tests/test_converter.py @@ -234,3 +234,25 @@ def test_matrix1(self): '' '' '') + + def test_vector_operator(self): + """Test for vector operator (GitHub issue #2)""" + mathml = 'AB' + + result = mathml2omml.convert(mathml) + print(result) + # The result should contain properly closed groupChrPr tags + self.assertIn('', result) + self.assertIn('', result) + self.assertIn('', result) + + def test_underscript_accent(self): + """Test for underscript with stretchy accent (GitHub issue #2)""" + mathml = 'AB_' + + result = mathml2omml.convert(mathml) + + # The result should contain properly closed groupChrPr tags + self.assertIn('', result) + self.assertIn('', result) + self.assertIn('', result) \ No newline at end of file