Skip to content

Commit dc6b4e8

Browse files
committed
fix embeded mathml in 2d graphics
1 parent f8c6cb0 commit dc6b4e8

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

mathics/builtin/graphics.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2601,8 +2601,8 @@ def to_svg(self):
26012601
content = self.content.boxes_to_xml(evaluation=self.graphics.evaluation)
26022602
style = create_css(font_color=self.color)
26032603
svg = (
2604-
'<foreignObject x="%f" y="%f" ox="%f" oy="%f" style="%s">'
2605-
"<math>%s</math></foreignObject>"
2604+
'<foreignObject x="%f" y="%f" ox="%f" oy="%f" width="100" height="100" style="%s">'
2605+
'<math xmlns="http://www.w3.org/1998/Math/MathML">%s</math></foreignObject>'
26062606
) % (x, y, self.opos[0], self.opos[1], style, content)
26072607
return svg
26082608

@@ -3236,7 +3236,7 @@ def boxes_to_xml(self, leaves=None, **options):
32363236
" ".join("%f" % t for t in (xmin, ymin, w, h)),
32373237
svg,
32383238
)
3239-
3239+
print("svg=", svg_xml)
32403240
return (
32413241
'<mglyph width="%dpx" height="%dpx" src="data:image/svg+xml;base64,%s"/>'
32423242
% (

0 commit comments

Comments
 (0)