Skip to content

Commit

Permalink
CopyAsMathML: encode "<" and ">" as "&lt;" and "&gt;" (valid XML).
Browse files Browse the repository at this point in the history
  • Loading branch information
daute committed Jan 4, 2025
1 parent 17fdad3 commit 19212a0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- If an empty worksheet is saved as wxmx, allow it to be read again (#1978).
The generated content.xml was empty, which was no valid XML.
- Fix compiling with clang++.
- CopyAsMathML: encode "<" and ">" as "&lt;" and "&gt;" (valid XML).

# 24.11.0

Expand Down
6 changes: 6 additions & 0 deletions src/cells/TextCell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1073,6 +1073,12 @@ wxString TextCell::ToMathML() const {
return wxS("<mo>") + text + wxS("</mo>\n");
}
}
if (text == wxS("<")) {
return wxS("<mo>&lt;</mo>");
}
if (text == wxS(">")) {
return wxS("<mo>&gt;</mo>");
}
else
return wxS("<mi>") + text + wxS("</mi>\n");
case TS_NUMBER:
Expand Down

0 comments on commit 19212a0

Please sign in to comment.