diff --git a/src/unescape.js b/src/unescape.js index 38d50bf30..5191ebd8c 100644 --- a/src/unescape.js +++ b/src/unescape.js @@ -1,6 +1,6 @@ // unescape common html entities -const matchHtmlEntity = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230);/g; +const matchHtmlEntity = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F);/g; const htmlEntities = { '&': '&', @@ -21,6 +21,7 @@ const htmlEntities = { '®': '®', '…': '…', '…': '…', + '/': '/', }; const unescapeHtmlEntity = (m) => htmlEntities[m]; diff --git a/test/unescape.spec.js b/test/unescape.spec.js index 07141adb5..ccb6393cc 100644 --- a/test/unescape.spec.js +++ b/test/unescape.spec.js @@ -3,9 +3,9 @@ import { unescape } from '../src/unescape'; describe('unescape', () => { it('should correctly unescape', () => { const unescaped = unescape( - '& & < < > > ' ' " "     © © ® ® … …', + '& & < < > > ' ' " "     © © ® ® … … /', ); - expect(unescaped).toEqual('& & < < > > \' \' " " © © ® ® … …'); + expect(unescaped).toEqual('& & < < > > \' \' " " © © ® ® … … /'); }); });