MCPcopy Create free account
hub / github.com/numpy/numpy / html_quote

Function html_quote

tools/npy_tempita/__init__.py:448–460  ·  view source on GitHub ↗
(value, force=True)

Source from the content-addressed store, hash-verified

446
447
448def html_quote(value, force=True):
449 if not force and hasattr(value, '__html__'):
450 return value.__html__()
451 if value is None:
452 return ''
453 if not isinstance(value, basestring_):
454 value = coerce_text(value)
455 if isinstance(value, bytes):
456 value = html_escape(value.decode('latin1'), 1)
457 value = value.encode('latin1')
458 else:
459 value = html_escape(value, 1)
460 return value
461
462
463def url(v):

Callers 2

attrFunction · 0.85
_reprMethod · 0.85

Calls 4

coerce_textFunction · 0.85
__html__Method · 0.80
decodeMethod · 0.80
encodeMethod · 0.80

Tested by

no test coverage detected