From c413d0ba6e4e2a79ae8d1e836379e1f02271dcbc Mon Sep 17 00:00:00 2001 From: coderaiser Date: Mon, 23 Apr 2018 17:02:12 +0300 Subject: [PATCH] feature(entity) add " --- common/entity.js | 1 + test/common/entity.js | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/common/entity.js b/common/entity.js index 8472a1bd..c3c718c4 100644 --- a/common/entity.js +++ b/common/entity.js @@ -4,6 +4,7 @@ const Entities = { ' ': ' ', '<': '<', '>': '>', + '"': '"', }; const keys = Object.keys(Entities); diff --git a/test/common/entity.js b/test/common/entity.js index 0c1d82ae..43b54d48 100644 --- a/test/common/entity.js +++ b/test/common/entity.js @@ -19,3 +19,11 @@ test('cloudcmd: entity: decode', (t) => { t.end(); }); +test('cloudcmd: entity: encode', (t) => { + const result = entity.encode('"hello"'); + const expected = '"hello"'; + + t.equal(result, expected, 'should encode entity'); + t.end(); +}); +