generated from simonw/python-lib-template-repository
-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
The :safe format specifier treats safe content as text that does not need to be escaped:
body = '<p>hi</p>'
result = html(t'<div>{body:safe}</div>')
# result.children[0] is a `Text()` node whose content is "safe".We'd also like for users to be able to say "treat this content as safe and parse it into a tree". Hence, :safetree:
body = '<p>hi</p>'
result = html(t'<div>{body:safetree}</div>')
# result.children[0] is a `Element(tag=p...)` nodeMetadata
Metadata
Assignees
Labels
No labels