summaryrefslogtreecommitdiff
path: root/doc/tools/makerst.py
diff options
context:
space:
mode:
Diffstat (limited to 'doc/tools/makerst.py')
-rwxr-xr-xdoc/tools/makerst.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/doc/tools/makerst.py b/doc/tools/makerst.py
index 6d9cd7140a..dc6d270c08 100755
--- a/doc/tools/makerst.py
+++ b/doc/tools/makerst.py
@@ -702,7 +702,11 @@ def rstize_text(text, state): # type: (str, State) -> str
escape_post = False
if tag_text in state.classes:
- tag_text = make_type(tag_text, state)
+ if tag_text == state.current_class:
+ # We don't want references to the same class
+ tag_text = '``{}``'.format(tag_text)
+ else:
+ tag_text = make_type(tag_text, state)
escape_post = True
else: # command
cmd = tag_text