-
-
Notifications
You must be signed in to change notification settings - Fork 100
Fixed bug with tag-raw not working with code snippets #271
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
* it didnt escape ``` correctly (\``` instead of \`\`\`) * adjusted test cases * added a new test case to cover this (and other more complex situations)
Kudos, SonarCloud Quality Gate passed! |
Could you share a screenshot of the output after fixing the bug? |
That said, I spot another bug. Embeds seem to mess up leading spaces (they are part of the message though). It doesnt seem like this is fixable though... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests failed to catch this, and if I reviewed this code (and tests) I wouldn't catch it either. Just something to note. ^^
application/src/test/java/org/togetherjava/tjbot/commands/utils/MessageUtilsTest.java
Show resolved
Hide resolved
Been a week since the last change. Got one approval by marko and one semi approval by illu (I guess). Merging. |
Bug
Fixes #269 .
Basically,
/tag-manage raw
did not escape triple backticks correctly.Resulting in crap like this:
Fix
The fix applied here is relatively simple, we still use the existing escaping utility but apply a patch on top where we replace its result with the proper result.
I slightly rewrote the code section to make it clearer that we now have a replace before and one after the escape utility. Otherwise its too easy to confuse with two replacements happening before, i.e.
I also adjusted the existing test cases and added a new unit test to cover this particular complex case as well.