fix indenting of comments

This commit is contained in:
Martin D Kealey 2022-01-12 17:58:02 +10:00
parent f9281abaea
commit 70cbaf8cf5

View file

@ -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 = { "&": "&amp;", "\"": "&quot;", "'": "&apos;", "<": "&lt;", ">": "&gt;", "/": "&#x2F;" }; const replacements = { "&": "&amp;", "\"": "&quot;", "'": "&apos;", "<": "&lt;", ">": "&gt;", "/": "&#x2F;" };
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 = [];