fix indenting of comments
This commit is contained in:
parent
f9281abaea
commit
70cbaf8cf5
1 changed files with 17 additions and 17 deletions
|
@ -59,29 +59,29 @@ const Utils = {
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Escapes any occurances of &, ", <, > or / with XML entities.
|
* Escapes any occurances of &, ", <, > or / with XML entities.
|
||||||
*
|
*
|
||||||
* @param {string} str
|
* @param {string} str
|
||||||
* The string to escape.
|
* The string to escape.
|
||||||
* @return {string} The escaped string.
|
* @return {string} The escaped string.
|
||||||
*/
|
*/
|
||||||
escapeXML(str) {
|
escapeXML(str) {
|
||||||
const replacements = { "&": "&", "\"": """, "'": "'", "<": "<", ">": ">", "/": "/" };
|
const replacements = { "&": "&", "\"": """, "'": "'", "<": "<", ">": ">", "/": "/" };
|
||||||
return String(str).replace(/[&"'<>/]/g, m => replacements[m]);
|
return String(str).replace(/[&"'<>/]/g, m => replacements[m]);
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A tagged template function which escapes any XML metacharacters in
|
* A tagged template function which escapes any XML metacharacters in
|
||||||
* interpolated values.
|
* interpolated values.
|
||||||
*
|
*
|
||||||
* @param {Array<string>} strings
|
* @param {Array<string>} strings
|
||||||
* An array of literal strings extracted from the templates.
|
* An array of literal strings extracted from the templates.
|
||||||
* @param {Array} values
|
* @param {Array} values
|
||||||
* An array of interpolated values extracted from the template.
|
* An array of interpolated values extracted from the template.
|
||||||
* @returns {string}
|
* @returns {string}
|
||||||
* The result of the escaped values interpolated with the literal
|
* The result of the escaped values interpolated with the literal
|
||||||
* strings.
|
* strings.
|
||||||
*/
|
*/
|
||||||
escaped(strings, ...values) {
|
escaped(strings, ...values) {
|
||||||
const result = [];
|
const result = [];
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue