const { parse } = require('@test/test-target'); // https://github.com/taoqf/node-html-parser/issues/203 describe('issue 203', function () { it('code element should not be null', function () { const root = parse(`
type Foo = { foo: 'bar' }
`, { blockTextElements: { script: true, noscript: true, style: true, } }); const t = root.firstChild.firstChild.firstChild.firstChild; t.toString().should.eql(`type Foo = { foo: 'bar' }`); const code = root.querySelector("code"); code.toString().should.eql(`type Foo = { foo: 'bar' }`); }); it('code element should not be null', function () { const root = parse(`

Country music legend, Trish Cotton, has something to say.

Written by Kyle Kasabian (@kylekasabian)
Directed by Derek Mari (@directorderek)
Director of Photography: Peter Mickelsen
Produced by Derek Mari and Kyle Kasabian
Edited by Derek Mari

Starring: Alyssa Sabo, Janine Hogan, and Kyle Kasabian

Assistant Camera: Casey Schoch
Production Sound: David Alvarez
Production Assistant: Keith Ahlstrom

Music by Morgan Matthews

Blink & Miss Productions
Bad Cat Films

`,); const description = root.querySelector('.description-wrapper'); description.toString().should.not.eql(null); }); });