From 1b0e836e95bbc57008529ed858d90150620b5573 Mon Sep 17 00:00:00 2001 From: Ben McCann <322311+benmccann@users.noreply.github.com> Date: Fri, 6 May 2022 11:03:54 -0700 Subject: [PATCH] slice -> substring --- src/runtime/internal/ssr.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/runtime/internal/ssr.ts b/src/runtime/internal/ssr.ts index ecffc82fa4..f9cd27bcbc 100644 --- a/src/runtime/internal/ssr.ts +++ b/src/runtime/internal/ssr.ts @@ -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) {