Skip to content
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

[V3 Utils] Make markdown helpers escape special chars #1841

Closed
Tobotimus opened this issue Jun 10, 2018 · 1 comment
Closed

[V3 Utils] Make markdown helpers escape special chars #1841

Tobotimus opened this issue Jun 10, 2018 · 1 comment
Labels
Type: Enhancement Something meant to enhance existing Red features.
Milestone

Comments

@Tobotimus
Copy link
Member

Feature request

Select the type of feature you are requesting:

  • API functionality

Describe your requested feature

Currently we have a bunch of helpers in redbot.core.utils.chat_formatting, including those which simply return some string formatted in some way with markdown, i.e. bold, italics, inline etc. All they do now is wrap the input string in the formatting delimiters and return - people are more likely to do this by just including the delims in their raw string, since it takes up less characters and doesn't require an import.

A way to actually make these functions useful would be to have them escape any relevant markdown formatting syntax within the input string.

Examples

Inline

Current behaviour:

>>> inline("a string` containing` backticks")
"`a string` containing` backticks`"

Formatted: a string containing backticks

After changes:

>>> inline("a string` containing` backticks")
"``a string` containing` backticks``"

Formatted: a string` containing` backticks

Italics

Current behaviour:

>>> italics("A string* containing *asterisks")
"*A string* containing *asterisks*"

Formatted: A string containing asterisks

After changes:

>>> italics("A string* containing *asterisks")
"*A string\* containing \*asterisks*"

Formatted: A string* containing *asterisks

@Tobotimus Tobotimus added Type: Enhancement Something meant to enhance existing Red features. V3 labels Jun 10, 2018
@Tobotimus Tobotimus added Status: Frozen We might make plans for this later. Category: Core and removed Category: Core labels Aug 13, 2018
@Tobotimus Tobotimus added this to the RC 1 milestone Sep 7, 2018
@Tobotimus Tobotimus added Status: Accepted We want this and removed Status: Frozen We might make plans for this later. labels Sep 7, 2018
@Tobotimus Tobotimus removed this from the RC 1 milestone Oct 1, 2018
@Twentysix26 Twentysix26 added Status: In Progress There's a PR open to deal with this, or an org member is working on this internally and removed Status: Accepted We want this labels Oct 4, 2018
@Tobotimus
Copy link
Member Author

Partially resolved by #2182, the unresolved ones don't seem to be solve-able right now.

@Tobotimus Tobotimus added this to the RC 1 milestone Oct 6, 2018
@Tobotimus Tobotimus removed the Status: In Progress There's a PR open to deal with this, or an org member is working on this internally label Oct 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement Something meant to enhance existing Red features.
Projects
None yet
Development

No branches or pull requests

2 participants