From 99db6663f3fa2332cd53f0dff98f12a6541dba98 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Tue, 27 Aug 2019 13:08:07 +0200 Subject: [PATCH] documentation/python: verify that HTML escaping is done for pybind as well. It is, even though I felt like it wasn't. Good to have to avoid double-escaping accidents in the future. --- .../test_python/pybind_signatures/pybind_signatures.cpp | 2 ++ .../test_python/pybind_signatures/pybind_signatures.html | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/documentation/test_python/pybind_signatures/pybind_signatures.cpp b/documentation/test_python/pybind_signatures/pybind_signatures.cpp index 62a9f655..a982f2b1 100644 --- a/documentation/test_python/pybind_signatures/pybind_signatures.cpp +++ b/documentation/test_python/pybind_signatures/pybind_signatures.cpp @@ -63,6 +63,8 @@ PYBIND11_MODULE(pybind_signatures, m) { .def("duck", &duck, "A function taking args/kwargs directly") .def("takes_a_function", &takesAFunction, "A function taking a Callable") .def("takes_a_function_returning_none", &takesAFunctionReturningVoid, "A function taking a Callable that returns None") + .def("escape_docstring", &voidFunction, "A docstring that should be escaped") + .def("failed_parse_docstring", &crazySignature, "A failed parse should also escape the docstring") .def("tenOverloads", &tenOverloads, "Ten overloads of a function") .def("tenOverloads", &tenOverloads, "Ten overloads of a function") diff --git a/documentation/test_python/pybind_signatures/pybind_signatures.html b/documentation/test_python/pybind_signatures/pybind_signatures.html index 43fd799a..2ff53e07 100644 --- a/documentation/test_python/pybind_signatures/pybind_signatures.html +++ b/documentation/test_python/pybind_signatures/pybind_signatures.html @@ -55,6 +55,14 @@ def duck(*args, **kwargs) -> None
A function taking args/kwargs directly
+
+ def escape_docstring(arg0: int, /) -> None +
+
A docstring that <em>should</em> be escaped
+
+ def failed_parse_docstring(…) +
+
A failed parse should <strong>also</strong> escape the docstring
def overloaded(arg0: int, /) -> str
-- 2.30.2