mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-07-14 09:40:39 +08:00
fix: enhance PR title cleaning by normalizing whitespace
This commit is contained in:
@ -761,8 +761,8 @@ class PRDescription:
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def clean_title(title: str) -> str:
|
def clean_title(title: str) -> str:
|
||||||
"""Clean the PR title by stripping whitespace and replacing newlines with spaces."""
|
"""Clean the PR title by normalizing all whitespace to a single space and stripping leading/trailing spaces."""
|
||||||
return title.strip().replace('\n', ' ')
|
return re.sub(r'\s+', ' ', title.strip())
|
||||||
|
|
||||||
|
|
||||||
def count_chars_without_html(string):
|
def count_chars_without_html(string):
|
||||||
|
Reference in New Issue
Block a user