diff options
Diffstat (limited to 'doc/tools/make_rst.py')
-rwxr-xr-x | doc/tools/make_rst.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/doc/tools/make_rst.py b/doc/tools/make_rst.py index 95022399a3..2594fa8cbd 100755 --- a/doc/tools/make_rst.py +++ b/doc/tools/make_rst.py @@ -1678,6 +1678,26 @@ def format_text_block( inside_code_tag = cmd escape_pre = True + valid_context = isinstance(context, (MethodDef, SignalDef, AnnotationDef)) + if valid_context: + endcode_pos = text.find("[/code]", endq_pos + 1) + if endcode_pos == -1: + print_error( + f"{state.current_class}.xml: Tag depth mismatch for [code]: no closing [/code] in {context_name}.", + state, + ) + break + + inside_code_text = text[endq_pos + 1 : endcode_pos] + context_params: List[ParameterDef] = context.parameters # type: ignore + for param_def in context_params: + if param_def.name == inside_code_text: + print_warning( + f'{state.current_class}.xml: Potential error inside of a code tag, found a string "{inside_code_text}" that matches one of the parameters in {context_name}.', + state, + ) + break + # Cross-references to items in this or other class documentation pages. elif is_in_tagset(cmd, RESERVED_CROSSLINK_TAGS): link_type: str = "" |