From 65e8a4a8518cceedbceb8cf3a932acebf8a4e3a0 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Wed, 3 Apr 2013 11:47:11 -0400 Subject: [PATCH 1/2] Escape the quotes in the tooltip message --- sphinx/ext/inheritance_diagram.py | 1 + 1 file changed, 1 insertion(+) diff --git a/sphinx/ext/inheritance_diagram.py b/sphinx/ext/inheritance_diagram.py index 6499e0782..9d17e73e8 100644 --- a/sphinx/ext/inheritance_diagram.py +++ b/sphinx/ext/inheritance_diagram.py @@ -250,6 +250,7 @@ class InheritanceGraph(object): if cls.__doc__: doc = cls.__doc__.strip().split("\n")[0] if doc: + doc = doc.replace('"', '\"') this_node_attrs['tooltip'] = '"%s"' % doc res.append(' "%s" [%s];\n' % (name, self._format_node_attrs(this_node_attrs))) From 9e962804a4dbbbf583aebadf3349b58617cf1988 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Mon, 8 Apr 2013 15:20:59 -0400 Subject: [PATCH 2/2] Forgot double slash --- sphinx/ext/inheritance_diagram.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sphinx/ext/inheritance_diagram.py b/sphinx/ext/inheritance_diagram.py index 9d17e73e8..b4f5f4307 100644 --- a/sphinx/ext/inheritance_diagram.py +++ b/sphinx/ext/inheritance_diagram.py @@ -250,7 +250,7 @@ class InheritanceGraph(object): if cls.__doc__: doc = cls.__doc__.strip().split("\n")[0] if doc: - doc = doc.replace('"', '\"') + doc = doc.replace('"', '\\"') this_node_attrs['tooltip'] = '"%s"' % doc res.append(' "%s" [%s];\n' % (name, self._format_node_attrs(this_node_attrs)))