Skip to content

Better escaping#68

Open
nokutu wants to merge 1 commit intodan1994:developfrom
nokutu:main
Open

Better escaping#68
nokutu wants to merge 1 commit intodan1994:developfrom
nokutu:main

Conversation

@nokutu
Copy link
Copy Markdown

@nokutu nokutu commented Nov 7, 2022

"[" and "]" characters are not being escaped in help


def _escaped_help(self):
return self.help.replace(r':', r'\:').replace('\n', ' ')
return self.help.replace(r':', r'\:').replace('\n', ' ').replace('[', '\[').replace(']', '\]')
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use raw strings for the replace (relevant especially for the replaced value):

.replace(r'[', r'\[').replace(r']', r'\]')

@dan1994 dan1994 changed the base branch from main to develop November 12, 2022 15:33
@dan1994
Copy link
Copy Markdown
Owner

dan1994 commented Nov 12, 2022

Thanks for contributing!

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.

2 participants