From d9b4ece093f256797e3596484e47818dac75e882 Mon Sep 17 00:00:00 2001 From: Jcrespo Date: Thu, 28 Jul 2022 12:33:53 +0200 Subject: [PATCH] Patch the make_rst.py utility to handle specially operators with '<' When generating rst files from xml class reference, unknown references to operators were generated, as something like: :ref:`operator <` was rendered in html as: operator ( Vector2 right ) -it just needed escaping. The small addendum checks for operator names containing '<' and substitutes it with '\<', escaping at rst level and generating instead the right rendered html: operator < ( Vector2 right ) This affected mostly the reference pages of the VectorX family of classes. If in the future more types need escaping, a more general solution will be needed. --- doc/tools/make_rst.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/tools/make_rst.py b/doc/tools/make_rst.py index 2aa4cb8ec13..469bb4a3100 100755 --- a/doc/tools/make_rst.py +++ b/doc/tools/make_rst.py @@ -1401,7 +1401,7 @@ def make_method_signature( if ref_type != "": if ref_type == "operator": out += ":ref:`{0}` ".format( - method_def.name, + method_def.name.replace("<", "\\<"), # So operator "<" gets correctly displayed. class_def.name, ref_type, sanitize_operator_name(method_def.name, state),