File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -31,13 +31,13 @@ def _set_attributes(element, **attributes):
3131 element .setAttribute (key , value )
3232
3333
34- def create_svg_object ():
34+ def create_svg_object (with_doctype ):
3535 imp = xml .dom .getDOMImplementation ()
3636 doctype = imp .createDocumentType (
3737 'svg' , '-//W3C//DTD SVG 1.1//EN' ,
3838 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'
3939 )
40- document = imp .createDocument (None , 'svg' , doctype )
40+ document = imp .createDocument (None , 'svg' , doctype if with_doctype else None )
4141 _set_attributes (
4242 document .documentElement ,
4343 version = '1.1' ,
@@ -235,13 +235,14 @@ def __init__(self):
235235 )
236236 self .compress = False
237237 self .dpi = 25.4
238+ self .with_doctype = True
238239 self ._document = None
239240 self ._root = None
240241 self ._group = None
241242
242243 def _init (self , code ):
243244 width , height = self .calculate_size (len (code [0 ]), len (code ), self .dpi )
244- self ._document = create_svg_object ()
245+ self ._document = create_svg_object (self . with_doctype )
245246 self ._root = self ._document .documentElement
246247 attributes = {
247248 'width' : SIZE .format (width ),
You can’t perform that action at this time.
0 commit comments