MCPcopy Create free account
hub / github.com/nodejs/node / _Replacement_write_data

Function _Replacement_write_data

tools/gyp/pylib/gyp/xml_fix.py:15–21  ·  view source on GitHub ↗

Writes datachars to writer.

(writer, data, is_attrib=False)

Source from the content-addressed store, hash-verified

13
14
15def _Replacement_write_data(writer, data, is_attrib=False):
16 """Writes datachars to writer."""
17 data = data.replace("&", "&amp;").replace("<", "&lt;")
18 data = data.replace('"', "&quot;").replace(">", "&gt;")
19 if is_attrib:
20 data = data.replace("\r", "&#xD;").replace("\n", "&#xA;").replace("\t", "&#x9;")
21 writer.write(data)
22
23
24def _Replacement_writexml(self, writer, indent="", addindent="", newl=""):

Callers 1

_Replacement_writexmlFunction · 0.85

Calls 1

writeMethod · 0.45

Tested by

no test coverage detected