We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d62daa7 commit f798a1eCopy full SHA for f798a1e
src/mkdocstrings_handlers/python/rendering.py
@@ -166,6 +166,15 @@ def do_format_signature(
166
),
167
)
168
169
+ # Since we highlight the signature without `def`,
170
+ # Pygments sees it as a function call and not a function definition.
171
+ # The result is that the function name is not parsed as such,
172
+ # but instead as a regular name: `n` CSS class instead of `nf`.
173
+ # To fix it, we replace the first occurrence of an `n` CSS class
174
+ # with an `nf` one, unless we found `nf` already.
175
+ if signature.find('class="nf"') == -1:
176
+ signature = signature.replace('class="n"', 'class="nf"', 1)
177
+
178
if stash:
179
for key, value in stash.items():
180
signature = re.sub(rf"\b{key}\b", value, signature)
0 commit comments