Skip to content

Commit 3d68eff

Browse files
Copilotseven7ty
andauthored
chore: preserve @ fidelity for code snippet outputs
Agent-Logs-Url: https://github.com/statch/gitbot/sessions/46b730a3-a822-49cd-9473-c994c6dd7db6 Co-authored-by: seven7ty <63970738+seven7ty@users.noreply.github.com>
1 parent 1670c48 commit 3d68eff

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

cogs/github/numbered/gist.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@ async def build_gist_embed(self,
9090

9191
stargazers_and_comments = f'{stargazers} and {comments}'
9292
info: str = f'{created_at}{updated_at}{stargazers_and_comments}'
93-
content: str = self.bot.mgr.sanitize_codeblock_content(self.bot.mgr.truncate(first_file['text'], 749, ' [...]'))
93+
content: str = self.bot.mgr.sanitize_codeblock_content(self.bot.mgr.truncate(first_file['text'], 749, ' [...]'),
94+
neutralize_mentions=False)
9495
embed.add_field(name=f':notepad_spiral: {ctx.l.gist.glossary[0]}:', value=f"```{self.extension(first_file['extension'])}\n{content}```")
9596
embed.add_field(name=f":mag_right: {ctx.l.gist.glossary[1]}:", value=info)
9697

cogs/github/other/snippets/_snippet_tools.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ async def get_text_from_url_and_data(ctx: 'GitBotContext',
5050
if text:
5151
text = text.rstrip()
5252
if wrap_in_codeblock:
53-
text = ctx.bot.mgr.sanitize_codeblock_content(text)
53+
text = ctx.bot.mgr.sanitize_codeblock_content(text, neutralize_mentions=False)
5454
return f"```{extension}\n{text}\n```", None
5555
return text, None
5656
return '', None

0 commit comments

Comments
 (0)