mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-07-04 12:50:38 +08:00
Improve markdown header sanitization in PR help message tool
This commit is contained in:
@ -138,7 +138,7 @@ class PRHelpMessage:
|
|||||||
for section in relevant_sections:
|
for section in relevant_sections:
|
||||||
file = section.get('file_name').strip().removesuffix('.md')
|
file = section.get('file_name').strip().removesuffix('.md')
|
||||||
if str(section['relevant_section_header_string']).strip():
|
if str(section['relevant_section_header_string']).strip():
|
||||||
markdown_header = section['relevant_section_header_string'].strip().strip('#').strip().lower().replace(' ', '-')
|
markdown_header = section['relevant_section_header_string'].strip().strip('#').strip().lower().replace(' ', '-').replace("'", '').replace('(', '').replace(')', '').replace(',', '').replace('.', '').replace('?', '').replace('!', '')
|
||||||
answer_str += f"> - {base_path}{file}#{markdown_header}\n"
|
answer_str += f"> - {base_path}{file}#{markdown_header}\n"
|
||||||
else:
|
else:
|
||||||
answer_str += f"> - {base_path}{file}\n"
|
answer_str += f"> - {base_path}{file}\n"
|
||||||
|
Reference in New Issue
Block a user