UNPKG

wooooosik6

Version:

Instant live reload tool for Tizen Web Application development

39 lines (33 loc) 960 B
const xml_special_to_encoded_attribute = { '&': '&amp;', '<': '&lt;', '"': '&quot;', '\r': '&#xD;', '\n': '&#xA;', '\t': '&#x9;' }; const xml_special_to_encoded_text = { '&': '&amp;', '<': '&lt;', '>': '&gt;', '\r': '&#xD;' }; function encodeSpecialCharactersInAttribute(attributeValue) { return attributeValue .replace(/[\r\n\t ]+/g, ' ') .replace(/([&<"\r\n\t])/g, function (str, item) { return xml_special_to_encoded_attribute[item]; }); } function encodeSpecialCharactersInText(text) { return text .replace(/\r\n?/g, '\n') .replace(/([&<>\r])/g, function (str, item) { return xml_special_to_encoded_text[item]; }); } // function ExclusiveCanonicalization() { exports.ExclusiveCanonicalization = { includeComments: false }; // exports.ExclusiveCanonicalization = ExclusiveCanonicalization;