diff --git a/src/js/utils.js b/src/js/utils.js index 2d65f4543..7f591157c 100644 --- a/src/js/utils.js +++ b/src/js/utils.js @@ -56,29 +56,29 @@ const Utils = { }, /** - * Escapes any occurances of &, ", <, > or / with XML entities. - * - * @param {string} str - * The string to escape. - * @return {string} The escaped string. - */ + * Escapes any occurances of &, ", <, > or / with XML entities. + * + * @param {string} str + * The string to escape. + * @return {string} The escaped string. + */ escapeXML(str) { const replacements = { "&": "&", "\"": """, "'": "'", "<": "<", ">": ">", "/": "/" }; return String(str).replace(/[&"'<>/]/g, m => replacements[m]); }, /** - * A tagged template function which escapes any XML metacharacters in - * interpolated values. - * - * @param {Array} strings - * An array of literal strings extracted from the templates. - * @param {Array} values - * An array of interpolated values extracted from the template. - * @returns {string} - * The result of the escaped values interpolated with the literal - * strings. - */ + * A tagged template function which escapes any XML metacharacters in + * interpolated values. + * + * @param {Array} strings + * An array of literal strings extracted from the templates. + * @param {Array} values + * An array of interpolated values extracted from the template. + * @returns {string} + * The result of the escaped values interpolated with the literal + * strings. + */ escaped(strings, ...values) { const result = [];