in js/vnext/layout/escape.js [3:31]
function pugEscape(_html) {
const html = String(_html);
const regexResult = pugMatch.exec(html);
if (!regexResult) {
return _html;
}
let result = '';
let i, lastIndex, escape;
for (i = regexResult.index, lastIndex = 0; i < html.length; i++) {
switch (html.charCodeAt(i)) {
case 34: escape = '"'; break;
case 38: escape = '&'; break;
case 60: escape = '<'; break;
case 62: escape = '>'; break;
default: continue;
}
if (lastIndex !== i) {
result += html.substring(lastIndex, i);
}
lastIndex = i + 1;
result += escape;
}
if (lastIndex !== i) {
return result + html.substring(lastIndex, i);
}
return result;
}