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
Fix regex in MOOSEDocs package extension #12611
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -115,7 +115,7 @@ def defaultSettings(): | |
|
||
def createToken(self, parent, info, page): | ||
content = info['inline'] if 'inline' in info else info['block'] | ||
content = re.sub(r'__(?P<package>[A-Z]+)__', self.subFunction, content, flags=re.UNICODE) | ||
content = re.sub(r'__(?P<package>[A-Z\_]+)__', self.subFunction, content, flags=re.UNICODE) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You don't have to escape characters in character classes. In fact this might be slightly incorrect now because I believe it'll match A-Z and underscore and a backslash. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't know why I "escaped" the underscore, I don't think it is ever needed. |
||
core.Code(parent, style="max-height:{};".format(self.settings['max-height']), | ||
language=self.settings['language'], content=content) | ||
return parent | ||
|
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.
You don't have to escape characters in character classes. In fact this might be slightly incorrect now because I believe it'll match A-Z and underscore and a backslash.