WebReflection / linkedom

A triple-linked lists based DOM implementation.
https://webreflection.medium.com/linkedom-a-jsdom-alternative-53dd8f699311
ISC License
1.62k stars 78 forks source link

Fixed: inspecting document.title deleted it as a side-effect (when cached) #266

Closed philipp-classen closed 4 months ago

philipp-classen commented 4 months ago

Minimal reproducible example with linkedom 0.16.10:

import { parseHTML } from 'linkedom/cached';

const html = '<!DOCTYPE html><html><head><title>Test</title></head><body></body></html>';
const { document } = parseHTML(html);
console.log('Title:', document.title); // Title: Test
console.log('Title:', document.title); // Title:          <-- missing (title removed as a side-effect)
WebReflection commented 4 months ago

Thanks! It's up and running. If you had an issue please be sure that gets closed too 👋