Skip to content
This repository was archived by the owner on Oct 9, 2023. It is now read-only.

Commit 324fee3

Browse files
author
Johannes Burghardt
committed
escape closing tags
1 parent 0971f5d commit 324fee3

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ const RIGHT = '-->';
66
const ENCODE = [
77
['&', '&'],
88
['>', '>'],
9+
['</', '&lt;/'],
910
];
1011

1112
const DATA_KEY = 'hypernova-key';

test/escape-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ describe('escaping', () => {
77
it('escapes', () => {
88
const html = serialize('foo', '', { foo: '</script>', bar: '&gt;' });
99

10-
assert.include(html, '</script&gt;');
10+
assert.include(html, '&lt;/script&gt;');
1111
assert.include(html, '&amp;gt;');
1212
});
1313

0 commit comments

Comments
 (0)