From 480a8907411db8cfe60b90b605b5b611b8e0233b Mon Sep 17 00:00:00 2001 From: mrT23 Date: Tue, 13 Feb 2024 18:33:22 +0200 Subject: [PATCH 1/2] no html bitbucket --- pr_agent/algo/utils.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/pr_agent/algo/utils.py b/pr_agent/algo/utils.py index e30e2844..df345511 100644 --- a/pr_agent/algo/utils.py +++ b/pr_agent/algo/utils.py @@ -49,8 +49,9 @@ def convert_to_markdown(output_data: dict, gfm_supported: bool=True) -> str: } markdown_text = "" markdown_text += f"## PR Review\n\n" - markdown_text += "\n\n" - markdown_text += """""" + if gfm_supported: + markdown_text += "
     PR feedback                    
\n\n" + markdown_text += """""" if not output_data or not output_data.get('review', {}): return "" @@ -60,8 +61,12 @@ def convert_to_markdown(output_data: dict, gfm_supported: bool=True) -> str: continue key_nice = key.replace('_', ' ').capitalize() emoji = emojis.get(key_nice, "") - markdown_text += f"\n" - markdown_text += "
     PR feedback                    
{emoji} {key_nice}\n\n{value}\n\n
\n" + if gfm_supported: + markdown_text += f" {emoji} {key_nice}\n\n{value}\n\n\n" + else: + markdown_text += f"{emoji} **{key_nice}:** {value}\n\n" + if gfm_supported: + markdown_text += "\n" if 'code_feedback' in output_data: if gfm_supported: From 54a989d30fde2124c2df440c273cb8460124abc3 Mon Sep 17 00:00:00 2001 From: mrT23 Date: Tue, 13 Feb 2024 18:37:48 +0200 Subject: [PATCH 2/2] no html bitbucket --- pr_agent/algo/utils.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pr_agent/algo/utils.py b/pr_agent/algo/utils.py index df345511..8d1918e9 100644 --- a/pr_agent/algo/utils.py +++ b/pr_agent/algo/utils.py @@ -64,7 +64,10 @@ def convert_to_markdown(output_data: dict, gfm_supported: bool=True) -> str: if gfm_supported: markdown_text += f" {emoji} {key_nice}\n\n{value}\n\n\n" else: - markdown_text += f"{emoji} **{key_nice}:** {value}\n\n" + if len(value.split()) > 1: + markdown_text += f"{emoji} **{key_nice}:**\n\n {value}\n\n" + else: + markdown_text += f"{emoji} **{key_nice}:** {value}\n\n" if gfm_supported: markdown_text += "\n"