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

Add "<" (&lt) to the ENCODE list #182

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const RIGHT = '-->';

const ENCODE = [
['&', '&amp;'],
['<', '&lt;'],
['>', '&gt;'],
];

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