Commit 826a94a9 authored by Michal Růžička's avatar Michal Růžička
Browse files

Merge pull request #18 from jimmyli97/develop

Bugfix for AbstractModules.replaceElements() 
parents 34536d49 9644e9eb
......@@ -125,8 +125,9 @@ abstract class AbstractModule implements Module {
final Element replacement = new Element(replacementName, toReplace.getNamespace());
replacement.addContent(toReplace.removeContent());
final List<Attribute> attributes = toReplace.getAttributes();
for (Attribute attribute : attributes) {
replacement.setAttribute(attribute.detach());
while (attributes.size() > 0) {
Attribute currentAttribute = attributes.get(0);
replacement.setAttribute(currentAttribute.detach());
}
final int parentIndex = parent.indexOf(toReplace);
parent.removeContent(parentIndex);
......
<?xml version="1.0" encoding="UTF-8"?>
<math xmlns="http://www.w3.org/1998/Math/MathML">
<mn>1</mn>
<mo>±</mo>
<mo mathvariant="normal" mathsize="big">±</mo>
<mrow>
<mo>(</mo>
<mo mathvariant="bold" mathsize="small" mathcolor="AliceBlue">(</mo>
<mi>x</mi>
<mo>/</mo>
<mn>3</mn>
......
<?xml version="1.0" encoding="UTF-8"?>
<math xmlns="http://www.w3.org/1998/Math/MathML">
<mn>1</mn>
<mi>+-</mi>
<mi mathvariant="normal" mathsize="big">+-</mi>
<mrow>
<mi>(</mi>
<mi mathvariant="bold" mathsize="small" mathcolor="AliceBlue">(</mi>
<mi>x</mi>
<mi>:</mi>
<mn>3</mn>
......
<?xml version="1.0" encoding="UTF-8"?>
<math xmlns="http://www.w3.org/1998/Math/MathML">
<msup>
<msub align="center">
<msub align="center" accentunder="true" id="1234">
<mi>x</mi>
<mn>1</mn>
</msub>
......
<?xml version="1.0" encoding="UTF-8"?>
<math xmlns="http://www.w3.org/1998/Math/MathML">
<mover>
<munder align="center">
<munder align="center" accentunder="true" id="1234">
<mi>x</mi>
<mn>1</mn>
</munder>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment