Skip to content

Fix issue with apparent codeblock within other codeblock#3527

Open
brass75 wants to merge 6 commits into
python-discord:mainfrom
brass75:issue-3522
Open

Fix issue with apparent codeblock within other codeblock#3527
brass75 wants to merge 6 commits into
python-discord:mainfrom
brass75:issue-3522

Conversation

@brass75

@brass75 brass75 commented Jun 24, 2026

Copy link
Copy Markdown

If there is a triple quoted string inside a codeblock that appears invalid the current implementation will trigger the the "Bat ticks message". This is confusing to the user and generally wrong because that happens to be correct. What needs to happen is that the we should isolate the codeblocks and make sure that the violating codeblock is notcontained within a codeblock.
This change handles that scenario by checking all of the invalid codeblocks to generate the correct message based on the invalid codeblock. If a message contains multiple invalid codeblocks and there is at least one that is using invalid ticks the invalid ticks message will be shown. If there is no codeblock with invalid ticks the missing language and no language logic will be followed without change.

Fixes #3522

brass75 added 5 commits June 24, 2026 16:36
If there is a triple quoted string inside a codeblock that that appears
invalid the current implementation will trigger the the "Bat ticks
message". This is confusing to the user and generally wrong because that
happens to be correct. What needs to happen is that the we should
isolate the codeblocks and make sure that the violating codeblock is not
contained within a codeblock.
This change handles that scenario by checking all of the invalid codeblocks
to generate the correct message based on the invalid codeblock. If a
message contains multiple invalid codeblocks and there is at least one that
is using invalid ticks the invalid ticks message will be shown. If there
is no codeblock with invalid ticks the missing language and no language
logic will be followed without change.
@brass75 brass75 requested a review from MarkKoz as a code owner June 24, 2026 21:01
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.

Code block recognition issue.

1 participant