Skip to content

Commit 64c6758

Browse files
committed
Fix further lint issues in inputoutput.rst
1 parent ecc86c3 commit 64c6758

1 file changed

Lines changed: 10 additions & 11 deletions

File tree

Doc/tutorial/inputoutput.rst

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ an ``f``:
200200
>>> template.values
201201
('World',)
202202

203-
:class:`~!string.templatelib.Template` instances are iterable, yielding each
203+
:class:`!Template` instances are iterable, yielding each
204204
string and :class:`~string.templatelib.Interpolation` in order:
205205

206206
.. testsetup::
@@ -280,8 +280,7 @@ update our ``user_html()`` function to return a :class:`~string.templatelib.Temp
280280
>>> def user_html(user: User) -> Template:
281281
... return t"<div><h1>{user.name}</h1></div>"
282282

283-
Now let's implement a function that sanitizes *any* HTML
284-
:class:`~!string.templatelib.Template`:
283+
Now let's implement a function that sanitizes *any* HTML :class:`!Template`:
285284

286285
>>> from html import escape
287286
>>> from string.templatelib import Template
@@ -293,10 +292,10 @@ Now let's implement a function that sanitizes *any* HTML
293292
... )
294293
...
295294

296-
This function iterates over the parts of the
297-
:class:`~!string.templatelib.Template`, escaping any interpolated values using
298-
the :func:`html.escape` function, which converts special characters like ``<``,
299-
``>``, and ``&`` into their HTML-safe equivalents.
295+
This function iterates over the parts of the :class:`!Template`, escaping any
296+
interpolated values using the :func:`html.escape` function, which converts
297+
special characters like ``<``, ``>``, and ``&`` into their HTML-safe
298+
equivalents.
300299

301300
Now we can tie it all together:
302301

@@ -327,10 +326,10 @@ Now we can tie it all together:
327326
We are no longer vulnerable to XSS attacks because we are escaping the
328327
interpolated values before they are included in the rendered HTML.
329328

330-
Of course, there's no need for code that processes
331-
:class:`~!string.templatelib.Template` instances to be limited to returning a
332-
simple string. For instance, we could imagine defining a more complex ``html()``
333-
function that returns a structured representation of the HTML:
329+
Of course, there's no need for code that processes :class:`!Template` instances
330+
to be limited to returning a simple string. For instance, we could imagine
331+
defining a more complex ``html()`` function that returns a structured
332+
representation of the HTML:
334333

335334
>>> from dataclasses import dataclass
336335
>>> from string.templatelib import Template

0 commit comments

Comments
 (0)