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

Commit

Permalink
escape closing tags
Browse files Browse the repository at this point in the history
  • Loading branch information
Johannes Burghardt committed Oct 11, 2019
1 parent 0971f5d commit 324fee3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const RIGHT = '-->';
const ENCODE = [
['&', '&'],
['>', '>'],
['</', '&lt;/'],
];

const DATA_KEY = 'hypernova-key';
Expand Down
2 changes: 1 addition & 1 deletion test/escape-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ describe('escaping', () => {
it('escapes', () => {
const html = serialize('foo', '', { foo: '</script>', bar: '&gt;' });

assert.include(html, '</script&gt;');
assert.include(html, '&lt;/script&gt;');
assert.include(html, '&amp;gt;');
});

Expand Down

0 comments on commit 324fee3

Please sign in to comment.