const { parse } = require('@test/test-target'); // https://github.com/taoqf/node-html-parser/issues/334 describe('script and style text is not entity-decoded', function () { it('keeps entities in a JSON-LD script', function () { const json = '{"name":"Tom & Jerry","d":"14" laptop"}'; const script = parse(``).querySelector('script'); script.text.should.eql(json); script.textContent.should.eql(json); script.firstChild.text.should.eql(json); JSON.parse(script.text).name.should.eql('Tom & Jerry'); }); it('keeps entities in a style', function () { const style = parse('').querySelector('style'); style.textContent.should.eql('a::after{content:">"}'); }); it('decodes the text around a script but not inside it', function () { const div = parse('