wooooosik6
Version:
Instant live reload tool for Tizen Web Application development
39 lines (33 loc) • 960 B
JavaScript
const xml_special_to_encoded_attribute = {
'&': '&',
'<': '<',
'"': '"',
'\r': '
',
'\n': '
',
'\t': '	'
};
const xml_special_to_encoded_text = {
'&': '&',
'<': '<',
'>': '>',
'\r': '
'
};
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;