MCPcopy Index your code
hub / github.com/nodejs/node / escape

Function escape

tools/inspector_protocol/markupsafe/_native.py:15–28  ·  view source on GitHub ↗

Convert the characters &, <, >, ' and " in string s to HTML-safe sequences. Use this if you need to display text that might contain such characters in HTML. Marks return value as markup string.

(s)

Source from the content-addressed store, hash-verified

13
14
15def escape(s):
16 """Convert the characters &, <, >, ' and " in string s to HTML-safe
17 sequences. Use this if you need to display text that might contain
18 such characters in HTML. Marks return value as markup string.
19 """
20 if hasattr(s, '__html__'):
21 return s.__html__()
22 return Markup(text_type(s)
23 .replace('&', '&amp;')
24 .replace('>', '&gt;')
25 .replace('<', '&lt;')
26 .replace("'", '&#39;')
27 .replace('"', '&#34;')
28 )
29
30
31def escape_silent(s):

Callers 11

escapeMethod · 0.90
_escape_argspecFunction · 0.90
urlizeFunction · 0.90
generate_lorem_ipsumFunction · 0.90
escape_silentFunction · 0.70
do_forceescapeFunction · 0.50
do_replaceFunction · 0.50
do_xmlattrFunction · 0.50
do_joinFunction · 0.50
visit_OutputMethod · 0.50
visit_OutputMethod · 0.50

Calls 2

MarkupClass · 0.90
__html__Method · 0.45

Tested by

no test coverage detected