Skip to content

Commit 318af04

Browse files
authored
Update util.js
1 parent 266e02e commit 318af04

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/util.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ export function encodeEntities(s) {
66
for (let i=0; i<s.length; i++) {
77
let ch = s[i];
88
switch (ch) {
9-
case '<': ch = '&lt;';
10-
case '>': ch = '&gt;';
11-
case '"': ch = '&quot;';
12-
case '&': ch = '&amp;';
9+
case '<': out += '&lt;'; break;
10+
case '>': out += '&gt;'; break;
11+
case '"': out += '&quot;'; break;
12+
case '&': out += '&amp;'; break;
13+
default: out += ch;
1314
}
14-
out += ch;
1515
}
1616
return out;
1717
}

0 commit comments

Comments
 (0)