diff options
author | Jcrespo <jcrespo@wikimedia.org> | 2022-07-28 12:33:53 +0200 |
---|---|---|
committer | Jcrespo <jcrespo@wikimedia.org> | 2022-07-28 12:37:30 +0200 |
commit | d9b4ece093f256797e3596484e47818dac75e882 (patch) | |
tree | fac7ec929d8eede5de650305dc8a96d7a575279a /doc/tools | |
parent | 7281f0f2381394a33300901a04fba100c5af79d9 (diff) |
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 <<class_Vector2_operator_lt_bool>`
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.
Diffstat (limited to 'doc/tools')
-rwxr-xr-x | doc/tools/make_rst.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/doc/tools/make_rst.py b/doc/tools/make_rst.py index 2aa4cb8ec1..469bb4a310 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}<class_{1}_{2}_{3}_{4}>` ".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), |