-
Notifications
You must be signed in to change notification settings - Fork 28
fix: Strip backslash before # in generated docstrings #677
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
Changes from all commits
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 |
|---|---|---|
|
|
@@ -170,8 +170,7 @@ private static String postProcessPandocOutput(String output) { | |
|
|
||
| // Remove unnecessary backslash escapes that pandoc adds for markdown | ||
| // These characters don't need escaping in Python docstrings | ||
| // Handles: [ ] ' { } ( ) < > ` @ _ * | ! ~ $ | ||
| output = output.replaceAll("\\\\([\\[\\]'{}()<>`@_*|!~$])", "$1"); | ||
| output = output.replaceAll("\\\\([\\[\\]'{}()<>`@_*|!~$#])", "$1"); | ||
|
Contributor
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. nit: We should be careful with the characters we unescape. Since our docstrings are in markdown, It's definitely a small risk but I think we may be able to escape it as This should be fine for now, but we should follow up to update how we escape markdown characters if it becomes a large issue.
Contributor
Author
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. It makes sense to me. We should look into it more deeply if there is a large issue in the future. |
||
|
|
||
| // Replace <note> and <important> tags with admonitions for mkdocstrings | ||
| output = replaceAdmonitionTags(output, "note", "Note"); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.