fix: enhance PR title cleaning by normalizing whitespace

This commit is contained in:
Abhinav Kumar
2025-07-10 18:06:44 +05:30
parent 85484899c3
commit d9eb0367cf

View File

@ -761,8 +761,8 @@ class PRDescription:
@staticmethod
def clean_title(title: str) -> str:
"""Clean the PR title by stripping whitespace and replacing newlines with spaces."""
return title.strip().replace('\n', ' ')
"""Clean the PR title by normalizing all whitespace to a single space and stripping leading/trailing spaces."""
return re.sub(r'\s+', ' ', title.strip())
def count_chars_without_html(string):