mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-07-04 12:50:38 +08:00
gfm_supported
This commit is contained in:
@ -62,7 +62,7 @@ def convert_to_markdown(output_data: dict, gfm_supported: bool=True) -> str:
|
|||||||
markdown_text += f"- {emoji} **{key}:**\n\n"
|
markdown_text += f"- {emoji} **{key}:**\n\n"
|
||||||
for item in value:
|
for item in value:
|
||||||
if isinstance(item, dict) and key.lower() == 'code feedback':
|
if isinstance(item, dict) and key.lower() == 'code feedback':
|
||||||
markdown_text += parse_code_suggestion(item)
|
markdown_text += parse_code_suggestion(item, gfm_supported)
|
||||||
elif item:
|
elif item:
|
||||||
markdown_text += f" - {item}\n"
|
markdown_text += f" - {item}\n"
|
||||||
if key.lower() == 'code feedback':
|
if key.lower() == 'code feedback':
|
||||||
@ -76,7 +76,7 @@ def convert_to_markdown(output_data: dict, gfm_supported: bool=True) -> str:
|
|||||||
return markdown_text
|
return markdown_text
|
||||||
|
|
||||||
|
|
||||||
def parse_code_suggestion(code_suggestions: dict) -> str:
|
def parse_code_suggestion(code_suggestions: dict, gfm_supported: bool=True) -> str:
|
||||||
"""
|
"""
|
||||||
Convert a dictionary of data into markdown format.
|
Convert a dictionary of data into markdown format.
|
||||||
|
|
||||||
@ -99,6 +99,7 @@ def parse_code_suggestion(code_suggestions: dict) -> str:
|
|||||||
markdown_text += f"\n - **{sub_key}:** {sub_value}\n"
|
markdown_text += f"\n - **{sub_key}:** {sub_value}\n"
|
||||||
else:
|
else:
|
||||||
markdown_text += f" **{sub_key}:** {sub_value}\n"
|
markdown_text += f" **{sub_key}:** {sub_value}\n"
|
||||||
|
if not gfm_supported:
|
||||||
if "relevant line" not in sub_key.lower(): # nicer presentation
|
if "relevant line" not in sub_key.lower(): # nicer presentation
|
||||||
markdown_text = markdown_text.rstrip('\n') + "\\\n"
|
markdown_text = markdown_text.rstrip('\n') + "\\\n"
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user