##// END OF EJS Templates
unicode fixes in SVG...
MinRK -
Show More
@@ -22,7 +22,7 b' from __future__ import print_function'
22 22 import os
23 23 import struct
24 24
25 from IPython.utils.py3compat import string_types
25 from IPython.utils.py3compat import string_types, cast_bytes_py2, cast_unicode
26 26
27 27 from .displaypub import publish_display_data
28 28
@@ -377,6 +377,7 b' class SVG(DisplayObject):'
377 377 return
378 378 # parse into dom object
379 379 from xml.dom import minidom
380 svg = cast_bytes_py2(svg)
380 381 x = minidom.parseString(svg)
381 382 # get svg tag (should be 1)
382 383 found_svg = x.getElementsByTagName('svg')
@@ -386,6 +387,7 b' class SVG(DisplayObject):'
386 387 # fallback on the input, trust the user
387 388 # but this is probably an error.
388 389 pass
390 svg = cast_unicode(svg)
389 391 self._data = svg
390 392
391 393 def _repr_svg_(self):
General Comments 0
You need to be logged in to leave comments. Login now