diff options
Diffstat (limited to 'doc/tools')
-rwxr-xr-x | doc/tools/makerst.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/doc/tools/makerst.py b/doc/tools/makerst.py index 6d9cd7140a..e81b4db13e 100755 --- a/doc/tools/makerst.py +++ b/doc/tools/makerst.py @@ -1,11 +1,10 @@ #!/usr/bin/env python3 import argparse -import sys import os import re import xml.etree.ElementTree as ET -from collections import defaultdict, OrderedDict +from collections import OrderedDict # Uncomment to do type checks. I have it commented out so it works below Python 3.5 #from typing import List, Dict, TextIO, Tuple, Iterable, Optional, DefaultDict, Any, Union @@ -702,7 +701,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 |