MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / _escape

Function _escape

tools/python-3.11.9-amd64/Lib/plistlib.py:161–171  ·  view source on GitHub ↗
(text)

Source from the content-addressed store, hash-verified

159 )
160
161def _escape(text):
162 m = _controlCharPat.search(text)
163 if m is not None:
164 raise ValueError("strings can't contain control characters; "
165 "use bytes instead")
166 text = text.replace("\r\n", "\n") # convert DOS line endings
167 text = text.replace("\r", "\n") # convert Mac line endings
168 text = text.replace("&", "&") # escape '&'
169 text = text.replace("<", "&lt;") # escape '<'
170 text = text.replace(">", "&gt;") # escape '>'
171 return text
172
173class _PlistParser:
174 def __init__(self, dict_type):

Callers 1

simple_elementMethod · 0.70

Calls 2

searchMethod · 0.45
replaceMethod · 0.45

Tested by

no test coverage detected