Skip to content

Backtick-quoted shortcut links in rule documentation #16010

@InSyncWithFoo

Description

@InSyncWithFoo

FAST002's rule documentation reads:

The [FastAPI documentation] recommends the use of [`typing.Annotated`] for
<!-- ... -->
[fastAPI documentation]: https://fastapi.tiangolo.com/tutorial/query-params-str-validations/?h=annotated#advantages-of-annotated
[typing.Annotated]: https://docs.python.org/3/library/typing.html#typing.Annotated

This is how PyCharm renders it:

And GitHub:

The FastAPI documentation recommends the use of [typing.Annotated] for

CommonMark dingus is no different:

<p>The <a href="https://fastapi.tiangolo.com/tutorial/query-params-str-validations/?h=annotated#advantages-of-annotated">FastAPI documentation</a> recommends the use of [<code>typing.Annotated</code>] for</p>

Shortcut reference links of the form [`something`] must have a corresponding link reference definition whose label is also backtick-quoted (related: #14348).

For reference, the matching algorithm is defined as:

One label matches another just in case their normalized forms are equal. To normalize a label, strip off the opening and closing brackets, perform the Unicode case fold, strip leading and trailing spaces, tabs, and line endings, and collapse consecutive internal spaces, tabs, and line endings to a single space.

Here's what a fix would look like:

 The [FastAPI documentation] recommends the use of [`typing.Annotated`] for
 <!-- ... -->
 [fastAPI documentation]: https://fastapi.tiangolo.com/tutorial/query-params-str-validations/?h=annotated#advantages-of-annotated
-[typing.Annotated]: https://docs.python.org/3/library/typing.html#typing.Annotated
+[`typing.Annotated`]: https://docs.python.org/3/library/typing.html#typing.Annotated

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationhelp wantedContributions especially welcome

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions