8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
doc.write
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Related with #3699
jsdom
const { JSDOM } = require("jsdom"); const dom = new JSDOM("<!DOCTYPE html><html><body></body></html>"); global.document = dom.window.document; global.window = dom.window; (async () => { const doc = document.implementation.createHTMLDocument(); const encoder = new TextEncoder(); const decoder = new TextDecoder(); const readable = new ReadableStream({ start: (controller) => { controller.enqueue(encoder.encode('<div>')); controller.enqueue(encoder.encode('text a')); controller.enqueue(encoder.encode("text c")); controller.enqueue(encoder.encode("</div>")); controller.close(); }}); const reader = readable.getReader(); while(true) { const { done, value } = await reader.read(); if(done) break doc.write(decoder.decode(value)); console.log(doc.documentElement.outerHTML) } })();
In JSDOM:
<html><head></head><body><div></div></body></html> <html><head></head><body><div>text a</div></body></html> <html><head></head><body><div>text c</div></body></html>
const doc = document.implementation.createHTMLDocument(); const encoder = new TextEncoder(); const decoder = new TextDecoder(); const readable = new ReadableStream({ start: (controller) => { controller.enqueue(encoder.encode('<div>')); controller.enqueue(encoder.encode('text a')); controller.enqueue(encoder.encode("text c")); controller.enqueue(encoder.encode("</div>")); controller.close(); }}); const reader = readable.getReader(); while(true) { const { done, value } = await reader.read(); if(done) break doc.write(decoder.decode(value)); console.log(doc.documentElement.outerHTML) }
In Chrome:
<html><head></head><body><div></div></body></html> <html><head></head><body><div>text a</div></body></html> <html><head></head><body><div>text atext c</div></body></html>
In Safari:
In Firefox:
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Related with #3699
Basic info:
Minimal reproduction case
In Node:
jsdom
In JSDOM:
How does similar code behave in browsers?
To reproduce in browsers:
In Chrome:
In Safari:
In Firefox:
The text was updated successfully, but these errors were encountered: