Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit282abd6

Browse files
authored
fix: do not bolden Holmes result (#1958)
1 parent5d38f08 commit282abd6

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

‎src/robusta/core/sinks/robusta/dal/model_conversion.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ def add_ai_chat_data(structured_data: List[Dict], block: HolmesChatResultsBlock)
123123
{
124124
"type":"markdown",
125125
"metadata":metadata,
126-
"data":Transformer.to_github_markdown(block.holmes_result.analysis),
126+
"data":Transformer.to_github_markdown(block.holmes_result.analysis,single_asterisks_is_bold=False),
127127
}
128128
)
129129
ModelConversion.append_to_structured_files(block.holmes_result.files,structured_data)
@@ -146,15 +146,15 @@ def add_ai_analysis_data(structured_data: List[Dict], block: HolmesResultsBlock)
146146
{
147147
"type":"markdown",
148148
"metadata": {"type":"ai_investigation_result"},
149-
"data":Transformer.to_github_markdown(block.holmes_result.analysis),
149+
"data":Transformer.to_github_markdown(block.holmes_result.analysis,single_asterisks_is_bold=False),
150150
}
151151
)
152152
ModelConversion.append_to_structured_data_tool_calls(block.holmes_result.tool_calls,structured_data)
153153
ifblock.holmes_result.sectionsandlen(block.holmes_result.sections)>0:
154154
transformed_sections= {}
155155
forsection_title,section_contentinblock.holmes_result.sections.items():
156156
ifsection_content:
157-
transformed_sections[section_title]=Transformer.to_github_markdown(section_content)
157+
transformed_sections[section_title]=Transformer.to_github_markdown(section_content,single_asterisks_is_bold=False)
158158

159159
structured_data.append(
160160
{

‎src/robusta/core/sinks/transformer.py‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def get_markdown_links(markdown_data: str) -> List[str]:
112112
returnlinks
113113

114114
@staticmethod
115-
defto_github_markdown(markdown_data:str,add_angular_brackets:bool=True)->str:
115+
defto_github_markdown(markdown_data:str,add_angular_brackets:bool=True,single_asterisks_is_bold:bool=True)->str:
116116
"""Transform all occurrences of slack markdown, <URL|LINK TEXT>, to github markdown [LINK TEXT](URL)."""
117117
# some markdown parsers doesn't support angular brackets on links
118118
OPENING_ANGULAR="<"ifadd_angular_bracketselse""
@@ -126,7 +126,11 @@ def to_github_markdown(markdown_data: str, add_angular_brackets: bool = True) ->
126126
parsed_url=parsed_url._replace(path=urllib.parse.quote_plus(parsed_url.path,safe="/"))
127127
replacement=f"[{splits[1]}]({OPENING_ANGULAR}{parsed_url.geturl()}{CLOSING_ANGULAR})"
128128
markdown_data=markdown_data.replace(match,replacement)
129-
returnre.sub(r"\*([^\*]*)\*",r"**\1**",markdown_data)
129+
130+
ifsingle_asterisks_is_bold:
131+
returnre.sub(r"\*([^\*]*)\*",r"**\1**",markdown_data)
132+
else:
133+
returnmarkdown_data
130134

131135
@classmethod
132136
def__markdown_to_html(cls,mrkdwn_text:str,html_class:str=None)->str:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp