-
Notifications
You must be signed in to change notification settings - Fork 1k
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 both <>
characters in SVG test labels
#6056
Escape both <>
characters in SVG test labels
#6056
Conversation
Also parametrize test_gate_with_less_greater_str so it is easier to add checks for more wire symbols.
cirq-core/cirq/contrib/svg/svg.py
Outdated
@@ -23,10 +23,7 @@ def fixup_text(text: str): | |||
if '[cirq.VirtualTag()]' in text: | |||
# https://github.com/quantumlib/Cirq/issues/2905 | |||
return text.replace('[cirq.VirtualTag()]', '') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we change the if statements above as well so that we don't return as soon as a single if
matches?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, of course! Done. I have left the first short-circuit if as it does not matter when the string is dropped.
* Test escaping both `<>` symbols in SVG Also parametrize test_gate_with_less_greater_str so it is easier to add checks for more wire symbols. * Escape both `<>` symbols when used as symbols in SVG * Skip typecheck at import of IPython.display * Test short-circuit fixup of a multi-line SVG text Strings with `\n` are replaced with '?'. * Test SVG replacements are all in effect * Apply all fixups to SVG string labels
Also parametrize
test_gate_with_less_greater_str
so it is easier toadd checks for more wire symbols later.