pdoc icon indicating copy to clipboard operation
pdoc copied to clipboard

Hyperlink reference gets parsed as docstring reference

Open HackXIt opened this issue 1 year ago • 0 comments

Problem Description

I have a hyperlink in the form of [alt-name](https://some.url.com).

I would expect that this hyperlink gets added as a link to the specified web-page. However, the URL of that link contains a notation that is identical to a reference for a docstring.

This results in the URL not being an external link, but rather it gets parsed as a docstring reference.

Real example:

"""
...
Further details about this can also be found in the [LVGL forum post where this was discussed](https://forum.lvgl.io/t/how-can-i-store-a-jpg-using-micropython-and-lvgl-snapshot/15135?u=hackxit).
...
"""

grafik

Steps to reproduce the behavior:

  1. Have a docstring reference which matches the dot-notation of a URL (e.g. module named url)
  2. Place the URL into a docstring: [alt-name](https://some.url.com)
  3. Hyperlink is parsed as docstring reference

System Information

pdoc: 14.5.0
Python: 3.11.2
Platform: Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.36

HackXIt avatar May 29 '24 23:05 HackXIt