Fix MarkdownUtil#monospace not correctly applying monospace formatting to strings with backticks - #3139
Open
ManosSef wants to merge 3 commits into
Open
Fix MarkdownUtil#monospace not correctly applying monospace formatting to strings with backticks#3139ManosSef wants to merge 3 commits into
MarkdownUtil#monospace not correctly applying monospace formatting to strings with backticks#3139ManosSef wants to merge 3 commits into
Conversation
…ing to strings with backticks
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.
Pull Request Etiquette
./gradlew formatChanges
Closes Issue: #3071
Description
Modifies the logic of
MarkdownUtil#monospace, so that it:Single backticks are allowed in monospace text by using double backticks as delimiters instead, and monospace text can start with backticks by inserting an extra space between the delimiter and the string, which does not appear on the client. These improvements allow the method to properly monospace text with backticks.
It is impossible to apply monospace formatting to text that contains both single and double backticks, so that case is not handled.
This should not be "out of scope" for JDA, since there is no complex parser logic involved. The current implementation is worse for text with backticks than just manually concatenating a backtick before and after the string, since it adds backslashes to the text which are shown on the client. This PR fixes the implementation enough to bring it on par with other methods in
MarkdownUtil.