MCPcopy Index your code
hub / github.com/python/cpython / _escape_attrib_html

Function _escape_attrib_html

Lib/xml/etree/ElementTree.py:1062–1073  ·  view source on GitHub ↗
(text)

Source from the content-addressed store, hash-verified

1060 _raise_serialization_error(text)
1061
1062def _escape_attrib_html(text):
1063 # escape attribute value
1064 try:
1065 if "&" in text:
1066 text = text.replace("&", "&")
1067 if ">" in text:
1068 text = text.replace(">", ">")
1069 if "\"" in text:
1070 text = text.replace("\"", """)
1071 return text
1072 except (TypeError, AttributeError):
1073 _raise_serialization_error(text)
1074
1075# --------------------------------------------------------------------
1076

Callers 1

_serialize_htmlFunction · 0.85

Calls 2

replaceMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…