Skip to content

Support Python 3.14 template strings for HTML formatting #121

@MaddyGuthridge

Description

@MaddyGuthridge

References:

Ideally, this would allow for HTML tags to be safely embedded within template strings.

>>> p.p(t"Bruno is {p.em("always")} hungry!")
<p>Bruno is <em>always</em> hungry</p>

In particular, note how with an f-string, the value would be escaped, resulting in incorrect output.

>>> p.p(f"Bruno is {p.em("always")} hungry!")
<p>Bruno is &lt;em&gt;always&lt;/em&gt; hungry</p>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions