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

Short anonymous hyperlink references get messed up #210

Closed
Wuestengecko opened this issue May 17, 2023 · 0 comments · Fixed by #213
Closed

Short anonymous hyperlink references get messed up #210

Wuestengecko opened this issue May 17, 2023 · 0 comments · Fixed by #213
Labels
C: convention Relates to docstring format convention P: bug PEP 257 violation or existing functionality that doesn't work as documented

Comments

@Wuestengecko
Copy link

docformatter doesn't correctly recognize the short form of anonymous hyperlink references (__ URI) as a special block, and merges them into the preceding paragraph:

     """[...]
 
     This graphics format generates terminal escape codes that transfer
-    PNG data to a TTY using the `kitty graphics protocol`__.
-
-    __ https://sw.kovidgoyal.net/kitty/graphics-protocol/
+    PNG data to a TTY using the `kitty graphics protocol
+    `__. __ https://sw.kovidgoyal.net/kitty/graphics-protocol/
     """

This breaks the reST, and makes Sphinx unable to correctly process the reference.

Note that this only affects this shorter form; the long form (.. __: URI) is unaffected. The following variation (correctly) remains unchanged by docformatter:

    """[...]

    This graphics format generates terminal escape codes that transfer
    PNG data to a TTY using the `kitty graphics protocol`__.

    .. __: https://sw.kovidgoyal.net/kitty/graphics-protocol/
    """

Bisecting brought up 7898b69 as the first "bad" commit, which is exactly v1.6.0. The earlier 917fed9 also changed the output already, but in a slightly different way and it was probably rewritten anyways.

@github-actions github-actions bot added the fresh This is a new issue label May 17, 2023
@weibullguy weibullguy added P: bug PEP 257 violation or existing functionality that doesn't work as documented C: convention Relates to docstring format convention and removed fresh This is a new issue labels May 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: convention Relates to docstring format convention P: bug PEP 257 violation or existing functionality that doesn't work as documented
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants