Skip to content

Commit 60bb674

Browse files
committed
Old example downgraded to INFO in docutils 0.22
1 parent bb2f3de commit 60bb674

1 file changed

Lines changed: 9 additions & 15 deletions

File tree

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,19 @@
11
"""Print 'Hello world' to the terminal; test links in docstrings.
22
3-
It is common in RST to use unnamed or anonymous links in text (like
4-
`here <https://example.com/t-and-c/>`__ and `here
5-
<https://example.org/co-op-rules.html>`__), but they should have two trailing
6-
underscores!
7-
8-
You *can* use a `single trailing underscore <https://example.com/links.html>`_
9-
but it is treated as an implicitly named link. You can use the exact same link
10-
text and URL again too (`single trailing underscore
11-
<https://example.com/links.html>`_).
12-
13-
However, the missing second underscore becomes a problem if the same link text
14-
is used again for another implicitly named link with a *different* URL (e.g.
15-
missing `single trailing underscore <https://example.com/bad.html>`_).
3+
Suppose we want to link to the Python_ home page, but have duplicate
4+
link targets defined?
165
176
What happens here?
187
198
$ flake8 --select RST RST220/dup_explicit_target.py
20-
RST220/dup_explicit_target.py:15:1: RST220 Duplicate explicit target name: "single trailing underscore".
9+
RST220/dup_explicit_target.py:3:1: RST399 Duplicate target name, cannot be used as a unique reference: "python".
10+
RST220/dup_explicit_target.py:15:1: RST220 Duplicate explicit target name: "python".
11+
12+
This file triggers an error as there are repeated conflicting definitions:
13+
14+
.. _Python: https://www.python.org
15+
.. _Python: https://python.org
2116
22-
This file triggers an error when the implicitly named link is redefined.
2317
""" # noqa: E501
2418

2519
print("Hello world")

0 commit comments

Comments
 (0)