feature(cloudcmd) improve support of NBSP

This commit is contained in:
coderaiser 2022-04-23 01:23:27 +03:00
parent e129ab6a79
commit 42c8fd7bfe
8 changed files with 40 additions and 39 deletions

View file

@ -5,21 +5,21 @@ const entity = require('../../common/entity');
test('cloudcmd: entity: encode', (t) => {
const result = entity.encode('<hello> ');
const expected = '&lt;hello&gt;&nbsp;';
const expected = '&lt;hello&gt; ';
t.equal(result, expected, 'should encode entity');
t.end();
});
test('cloudcmd: entity: decode', (t) => {
const result = entity.decode('&lt;hello&gt;&nbsp;');
const result = entity.decode('&lt;hello&gt; ');
const expected = '<hello> ';
t.equal(result, expected, 'should decode entity');
t.end();
});
test('cloudcmd: entity: encode', (t) => {
test('cloudcmd: entity: encode quote', (t) => {
const result = entity.encode('"hello"');
const expected = '&quot;hello&quot;';