Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions mathml2omml/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -747,7 +747,7 @@ def to_str(self):
'<m:groupChrPr>'
'<m:chr m:val="%s"/>'
'<m:pos m:val="bot"/>'
'</m:groupChr>'
'</m:groupChrPr>'
'%s'
'</m:groupChr>') % (underscript.escape_text(), base)
return ('<m:limLow>'
Expand Down Expand Up @@ -784,7 +784,7 @@ def to_str(self):
'<m:groupChrPr>'
'<m:chr m:val="%s"/>'
'<m:pos m:val="top"/>'
'</m:groupChr>'
'</m:groupChrPr>'
'%s'
'</m:groupChr>') % (overscript.escape_text(), base)
return ('<m:limUpp>'
Expand Down
22 changes: 22 additions & 0 deletions tests/test_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,3 +234,25 @@ def test_matrix1(self):
'</m:e></m:box></m:e>'
'</m:mr>'
'</m:m></m:e></m:box></m:oMath>')

def test_vector_operator(self):
"""Test for vector operator (GitHub issue #2)"""
mathml = '<math><mover><mi>AB</mi><mo stretchy="true" accent="true">→</mo></mover></math>'

result = mathml2omml.convert(mathml)
print(result)
# The result should contain properly closed groupChrPr tags
self.assertIn('</m:groupChrPr>', result)
self.assertIn('<m:groupChr>', result)
self.assertIn('</m:groupChr>', result)

def test_underscript_accent(self):
"""Test for underscript with stretchy accent (GitHub issue #2)"""
mathml = '<math><munder><mi>AB</mi><mo stretchy="true" accent="true">_</mo></munder></math>'

result = mathml2omml.convert(mathml)

# The result should contain properly closed groupChrPr tags
self.assertIn('</m:groupChrPr>', result)
self.assertIn('<m:groupChr>', result)
self.assertIn('</m:groupChr>', result)