Skip to content

Commit d604b6b

Browse files
committed
Skip already multiline signatures in formatter
1 parent a794440 commit d604b6b

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

great_docs/assets/post-render.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ def format_signature_multiline(html_content):
4242
arg1=default1,
4343
arg2=default2,
4444
)
45+
46+
Signatures that are already multiline (from quartodoc) are skipped.
4547
"""
4648
# Pattern to match the content inside signature spans
4749
# The signature is inside <span id="cbN-1">...(args)</span>
@@ -54,6 +56,11 @@ def reformat_signature(match):
5456
content = match.group(3)
5557
span_end = match.group(4)
5658

59+
# Skip if signature is already multiline (quartodoc formatted it)
60+
# This is detected by checking if content ends with just "(" or has a newline
61+
if content.strip().endswith("(") or "\n" in content:
62+
return full_match
63+
5764
# Find the opening paren position
5865
paren_pos = content.find("(")
5966
if paren_pos == -1:

0 commit comments

Comments
 (0)