I cannot find a location in the documentation explaining the need to escape certain characters like "&". Graphviz throws an error when using these symbols. I found that the proper way to escape the ampersand is &. I think it would be helpful to mention this in the WireViz docs. I haven't tested any other characters that might need escaping.
The error thrown is:
Error: not well-formed (invalid token) in line 37
... asdf&asdf</td> ...
in label of node W1
Warning: node W1, port w1 unrecognized
Warning: node W1, port w1 unrecognized
Traceback (most recent call last):
File "C:\Users\jacob\Envs\wireviz\Scripts\wireviz-script.py", line 33, in <module>
sys.exit(load_entry_point('wireviz==0.3.dev0', 'console_scripts', 'wireviz')())
File "C:\Users\jacob\Envs\wireviz\lib\site-packages\wireviz-0.3.dev0-py3.9.egg\wireviz\wireviz.py", line 268, in main
parse(yaml_input, file_out=file_out.resolve())
File "C:\Users\jacob\Envs\wireviz\lib\site-packages\wireviz-0.3.dev0-py3.9.egg\wireviz\wireviz.py", line 187, in parse
harness.output(filename=file_out, fmt=('png', 'svg'), view=False)
File "C:\Users\jacob\Envs\wireviz\lib\site-packages\wireviz-0.3.dev0-py3.9.egg\wireviz\Harness.py", line 372, in output
graph.render(filename=filename, view=view, cleanup=cleanup)
File "C:\Users\jacob\Envs\wireviz\lib\site-packages\graphviz\files.py", line 243, in render
rendered = backend.render(self._engine, format, filepath,
File "C:\Users\jacob\Envs\wireviz\lib\site-packages\graphviz\backend.py", line 223, in render
run(cmd, capture_output=True, cwd=cwd, check=True, quiet=quiet)
File "C:\Users\jacob\Envs\wireviz\lib\site-packages\graphviz\backend.py", line 183, in run
raise CalledProcessError(proc.returncode, cmd,
graphviz.backend.CalledProcessError: Command '['dot', '-Kdot', '-Tpng', '-O', 'minamp']' returned non-zero exit status 1. [stderr: b'Error: not well-formed (invalid token) in line 37 \r\n... asdfa&</td> ...\r\nin label of node W1\r\nWarning: node W1, port w1 unrecognized\r\nWarning: node W1, port w1 unrecognized\r\n']
I cannot find a location in the documentation explaining the need to escape certain characters like "&". Graphviz throws an error when using these symbols. I found that the proper way to escape the ampersand is
&
. I think it would be helpful to mention this in the WireViz docs. I haven't tested any other characters that might need escaping.The error thrown is:
My code to replicate: