From 4d23b7b770a1bac0ea35889d2da2f3fb690d5ffd Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Wed, 3 Feb 2021 17:10:41 +0100 Subject: [PATCH] work around a GraphViz 2.60.0 bug * spot/twa/twagraph.cc (dump_storage_as_dot): Prefer \n over a plain new line to work around GraphViz issue 1931, which was causing twagraph-internals.ipynb to fail in our test suite. --- spot/twa/twagraph.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/spot/twa/twagraph.cc b/spot/twa/twagraph.cc index 38e302c96..d652fdaa1 100644 --- a/spot/twa/twagraph.cc +++ b/spot/twa/twagraph.cc @@ -896,9 +896,14 @@ namespace spot if (!named_prop_.empty()) { - out << "namedprops [label=\"named properties:\n"; + // GraphiViz 2.46.0 has a bug where plain newlines in + // quoted strings are ignored. See + // https://gitlab.com/graphviz/graphviz/-/issues/1931 + // A workaround is to use emit \n instead of the + // actual new line. + out << "namedprops [label=\"named properties:\\n"; for (auto p: named_prop_) - escape_html(out, p.first) << '\n'; + escape_html(out, p.first) << "\\n"; out << "\"]\n"; } }