Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Escape Characters are not Documented #266

Open
jacobian91 opened this issue Jan 15, 2022 · 1 comment
Open

Escape Characters are not Documented #266

jacobian91 opened this issue Jan 15, 2022 · 1 comment

Comments

@jacobian91
Copy link

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&amp</td> ...\r\nin label of node W1\r\nWarning: node W1, port w1 unrecognized\r\nWarning: node W1, port w1 unrecognized\r\n']

My code to replicate:

cables:
  W1:
    notes: asdfa&asdf
    wirecount: 1

connectors:
  C1:
    pincount: 2
  
connections:
  - - C1: [1,2]
    - W1: [1,1]
@kvid
Copy link
Collaborator

kvid commented Jan 30, 2022

This issue seems to be related to #230.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants