Доработки конвертирования из буфера обмена

This commit is contained in:
Book Pauk
2020-02-06 21:04:40 +07:00
parent 8007991e7d
commit a6bdccd4ef
3 changed files with 16 additions and 1 deletions

View File

@@ -193,4 +193,13 @@ export function parseQuery(str) {
query[first] = [query[first], second];
}
return query;
}
export function escapeXml(str) {
return str.replace(/&/g, '&')
.replace(/</g, '&lt;')
.replace(/>/g, '&gt;')
.replace(/"/g, '&quot;')
.replace(/'/g, '&apos;')
;
}