Skip to content

Commit a768383

Browse files
Copilotseven7ty
andauthored
chore: refine code fence escaping and cleanup reassignment typing
Agent-Logs-Url: https://github.com/statch/gitbot/sessions/71de78f4-95f9-4b00-bbde-4a621af540f1 Co-authored-by: seven7ty <63970738+seven7ty@users.noreply.github.com>
1 parent d5bff84 commit a768383

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

cogs/github/numbered/commits.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@ async def commit_command(self,
115115
message: str = (f"{self.bot.mgr.truncate(commit['messageBody'], 247, full_word=True)}"
116116
if commit['messageBody'] and commit['messageBody'] != commit['messageHeadline']
117117
else '')
118-
full_headline: str = self.bot.mgr.sanitize_codeblock_content(full_headline)
119-
message: str = self.bot.mgr.sanitize_codeblock_content(message)
118+
full_headline = self.bot.mgr.sanitize_codeblock_content(full_headline)
119+
message = self.bot.mgr.sanitize_codeblock_content(message)
120120
empty: str = ctx.l.commit.fields.message.empty if not full_headline and not message else ''
121121
message: str = '```' + full_headline + message + empty + '```'
122122
embed.add_field(name=f':notepad_spiral: {ctx.l.commit.fields.message.name}:', value=message)

lib/manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ def sanitize_codeblock_content(content: str | None, neutralize_mentions: bool =
242242
"""
243243
if not content:
244244
return ''
245-
content = content.replace('```', '`\u200b``')
245+
content = content.replace('```', '`\u200b`\u200b`')
246246
if neutralize_mentions:
247247
content = content.replace('@', '@\u200b')
248248
return content

0 commit comments

Comments
 (0)