Skip to content

Conversation

@danthe1st
Copy link
Member

The bot attempts to automatically format messages containing code using codeblocks (#425).

This PR changes that behaviour so that messages are not formatted when the first { and last } are on the same line and also not if a message contains even a single backtick (instead of three).

The former is because things like {something} probably don't need codeblocks and the latter is due to the assumption that messages containing backticks are probably formatted in some way. If they already formatted a part of the code, they might want their formatting to be used.

See also https://canary.discord.com/channels/648956210850299986/1150336575675318272 and probably also similar threads where the bot formatted messages that shouldn't be changed.

@danthe1st danthe1st requested a review from a team as a code owner September 10, 2023 15:45
Copy link
Contributor

@Pleezon Pleezon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, was needed

@MoonTM-GIT MoonTM-GIT merged commit 0ef9cda into Java-Discord:main Sep 18, 2023
@danthe1st danthe1st deleted the codeblock-detection branch September 18, 2023 10:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants