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

Fix regex in MOOSEDocs package extension #12611

Merged
merged 2 commits into from Jan 2, 2019

Conversation

aeslaughter
Copy link
Contributor

(refs #12528)

@moosebuild
Copy link
Contributor

moosebuild commented Dec 14, 2018

Job Documentation on 4f3bd78 wanted to post the following:

View the site here

This comment will be updated on new commits.

milljm
milljm previously approved these changes Dec 14, 2018
Copy link
Member

@milljm milljm left a comment

Choose a reason for hiding this comment

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

👍

@@ -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)
Copy link
Member

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.

@@ -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)
Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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.

@permcody permcody merged commit bc1fcab into idaholab:next Jan 2, 2019
@aeslaughter aeslaughter deleted the package-extension branch June 5, 2019 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants