MCPcopy Create free account
hub / github.com/datapane/datapane / html_escape

Function html_escape

python-client/src/datapane/_vendor/bottle.py:3091–3094  ·  view source on GitHub ↗

Escape HTML special characters ``&<>`` and quotes ``'"``.

(string)

Source from the content-addressed store, hash-verified

3089
3090
3091def html_escape(string):
3092 """ Escape HTML special characters ``&<>`` and quotes ``'"``. """
3093 return string.replace('&', '&amp;').replace('<', '&lt;').replace('>', '&gt;')\
3094 .replace('"', '&quot;').replace("'", '&#039;')
3095
3096
3097def html_quote(string):

Callers 2

wsgiMethod · 0.85
html_quoteFunction · 0.85

Calls 1

replaceMethod · 0.45

Tested by

no test coverage detected