File tree 3 files changed +6
-6
lines changed
3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -551,7 +551,7 @@ def set_dot_basics(dot, options):
551
551
bgcolor = options .bgcolor .html ,
552
552
nodesep = "0.33" ,
553
553
fontname = options .fontname ,
554
- )
554
+ ) # TODO: Add graph attribute: charset="utf-8",
555
555
dot .attr (
556
556
"node" ,
557
557
shape = "none" ,
Original file line number Diff line number Diff line change @@ -391,7 +391,7 @@ def png(self):
391
391
return data .read ()
392
392
393
393
@property
394
- def svg (self ):
394
+ def svg (self ): # TODO?: Verify xml encoding="utf-8" in SVG?
395
395
graph = self .graph
396
396
return embed_svg_images (graph .pipe (format = "svg" ).decode ("utf-8" ), Path .cwd ())
397
397
Original file line number Diff line number Diff line change @@ -69,9 +69,9 @@ def embed_svg_images_file(
69
69
) -> None :
70
70
filename_in = Path (filename_in ).resolve ()
71
71
filename_out = filename_in .with_suffix (".b64.svg" )
72
- filename_out .write_text (
72
+ filename_out .write_text ( # TODO?: Verify xml encoding="utf-8" in SVG?
73
73
embed_svg_images (filename_in .read_text (), filename_in .parent )
74
- )
74
+ ) # TODO: Use encoding="utf-8" in both read_text() and write_text()
75
75
if overwrite :
76
76
filename_out .replace (filename_in )
77
77
@@ -95,11 +95,11 @@ def generate_html_output(
95
95
# fall back to built-in simple template if no template was provided
96
96
templatefile = Path (wireviz .__file__ ).parent / "templates/simple.html"
97
97
98
- html = file_read_text (templatefile )
98
+ html = file_read_text (templatefile ) # TODO?: Warn if unexpected meta charset?
99
99
100
100
# embed SVG diagram (only if used)
101
101
def svgdata () -> str :
102
- return re .sub (
102
+ return re .sub ( # TODO?: Verify xml encoding="utf-8" in SVG?
103
103
"^<[?]xml [^?>]*[?]>[^<]*<!DOCTYPE [^>]*>" ,
104
104
"<!-- XML and DOCTYPE declarations from SVG file removed -->" ,
105
105
file_read_text (f"{ filename } .tmp.svg" ),
You can’t perform that action at this time.
0 commit comments