Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
minor copyedit to HTML example
  • Loading branch information
merwok authored May 7, 2025
commit 2261c4d22f6520c85617e4ccfa1243edb0bbf7b0
4 changes: 2 additions & 2 deletions Doc/whatsnew/3.14.rst
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,8 @@ As another example, generating HTML attributes from data:
.. code-block:: python

attributes = {"src": "shrubbery.jpg", "alt": "looks nice"}
template = t"<img {attributes} />"
assert html(template) == '<img src="shrubbery.jpg" alt="looks nice" class="looks-nice" />'
template = t"<img {attributes}>"
Comment thread
vstinner marked this conversation as resolved.
assert html(template) == '<img src="shrubbery.jpg" alt="looks nice" class="looks-nice">'

Unlike f-strings, the ``html`` function has access to template attributes
containing the original information: static strings, interpolations, and values
Expand Down