Skip to content

Commit c413d0b

Browse files
committed
feature(entity) add "
1 parent 44e2ec7 commit c413d0b

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

common/entity.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ const Entities = {
44
' ': ' ',
55
'&lt;': '<',
66
'&gt;': '>',
7+
'&quot;': '"',
78
};
89

910
const keys = Object.keys(Entities);

test/common/entity.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,11 @@ test('cloudcmd: entity: decode', (t) => {
1919
t.end();
2020
});
2121

22+
test('cloudcmd: entity: encode', (t) => {
23+
const result = entity.encode('"hello"');
24+
const expected = '&quot;hello&quot;';
25+
26+
t.equal(result, expected, 'should encode entity');
27+
t.end();
28+
});
29+

0 commit comments

Comments
 (0)