websauna.utils.html module

HTML manipulation helpers.

websauna.utils.html.escape_js(value)[source]

Hex encodes characters for use in JavaScript strings.

Parameters

value (AnyStr) – String to be escaped.

Return type

str

Returns

A string safe to be included inside a <script> tag.