Escape nicknames in patrick responses. - #67
Open
JoBeGaming wants to merge 9 commits into
Open
JoBeGaming wants to merge 9 commits into
JoBeGaming wants to merge 9 commits into
Conversation
…me is used in a reply or log message.
JoBeGaming
marked this pull request as draft
September 11, 2026 16:55
Nickster258
requested changes
Sep 14, 2026
Nickster258
left a comment
Member
There was a problem hiding this comment.
Probably shouldn't escape the logged statements. At the same time, would be worth logging the user ID in the event message.
Member
|
67 |
Wueffi
reviewed
Sep 15, 2026
Wueffi
suggested changes
Sep 15, 2026
Contributor
Author
|
Weird how my commit from VSC got added, but the reply didn't get send... |
JoBeGaming
marked this pull request as ready for review
September 15, 2026 10:16
Contributor
Author
|
Ok seems like I've forgotten to add cases such as |
Contributor
Author
assert escape_nickname("> job") == r"\> job"
assert escape_nickname("*job*") == r"\*job\*"
assert escape_nickname("**job**") == r"\*\*job\*\*"
assert escape_nickname("_job_") == r"\_job\_"
assert escape_nickname("__job__") == r"\_\_job\_\_"
assert escape_nickname("`job`") == r"\`job\`"
assert escape_nickname("> job") == r"\> job"
assert escape_nickname("~~job~~") == r"\~\~job\~\~"
assert escape_nickname("||job||") == r"\|\|job\|\|"
assert escape_nickname("# job") == r"\# job"
assert escape_nickname("- job") == r"\- job"
assert escape_nickname("-# job") == r"\-\# job"(Updated test-cases if anyone is interested) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See https://discord.com/channels/116914772766752769/165640273810948097/1544019167798239233 for embeds, and https://discord.com/channels/116914772766752769/1216162486152335471/1544010187546038282 as well as https://discord.com/channels/116914772766752769/1216162486152335471/1544010104511266841 for nickame usage in normal commands.
For tests, the output of the test attached was sent in https://discord.com/channels/116914772766752769/165640273810948097/1544010979694608516, and seems to raise no issues with Discord Markdown. See https://discord.com/channels/116914772766752769/165640273810948097/1544023339042087113 for tests related to links. Note that I've not implemented direct link escaping (
https://www.youtube.com) yet.(Edit: Fix name of function in tests)