Skip to content

Commit

Permalink
slice -> substring
Browse files Browse the repository at this point in the history
  • Loading branch information
benmccann committed May 6, 2022
1 parent 88e2146 commit 1b0e836
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/runtime/internal/ssr.ts
Expand Up @@ -84,11 +84,11 @@ export function escape(html: string, is_attr = false) {
while (pattern.test(html)) {
const i = pattern.lastIndex - 1;
const ch = html[i];
escaped += html.slice(last, i) + (ch === '&' ? '&' : (ch === '"' ? '"' : '<'));
escaped += html.substring(last, i) + (ch === '&' ? '&' : (ch === '"' ? '"' : '<'));
last = i + 1;
}

return escaped + html.slice(last);
return escaped + html.substring(last);
}

export function escape_attribute_value(value) {
Expand Down

0 comments on commit 1b0e836

Please sign in to comment.