-
Notifications
You must be signed in to change notification settings - Fork 67
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
I believe URL_REGEX is missing a |
#269
Comments
By the way, I noticed this because I was looking at the big comment explaining If (after this issue is resolved) I submitted a PR to try writing a 'verbose' version of this regex with explanation 'inline', is this something you would be interested in? |
comparing the 'URL_REGEX explanation comment':
# (__ |`{{2}}|`\w[\w. :\n]*|\.\. _?[\w. :]+|')? is used to find in-line links that
to the actual first line of the regex:
rf"(__ |`{{2}}|`\w[\w :#\n]*[.|\.\. _?[\w. :]+|')?<?"
the actual regex seems to be 'missing' a
|
between:and
This seems to have been removed in #213 , which doesn't seem intentional to me, as it doesn't seem obviously related to the change that PR was trying to fix (although it's possible I'm misunderstanding here, sorry if so!).
I think this does affect the wrapping behaviour - links in the format starting with
..
seem to not get wrapped (although I'm not 100% sure I've understand the expected behaviour). A file with these contents:produces this output when docformatter is run over it, only reformatting the link with a different format:
I think maybe this isn't obvious/impactful because this kind of link is 'explicit markup' that according to ReST can only start a line of ReST, so it's probably infrequent that you get a link and reference long enough that this would reformat it anyway.
The text was updated successfully, but these errors were encountered: