|
// retoor <retoor@molodetz.nl>
|
|
|
|
import "html" for Document
|
|
|
|
var doc = Document.parse("<div>Hello</div>")
|
|
System.print(doc != null) // expect: true
|
|
|
|
var doc2 = Document.parse("<html><head></head><body></body></html>")
|
|
System.print(doc2.documentElement != null) // expect: true
|
|
|
|
var doc3 = Document.parse("")
|
|
System.print(doc3 != null) // expect: true
|
|
|
|
var doc4 = Document.parse("<p>Text</p>")
|
|
System.print(doc4.querySelector("p").textContent) // expect: Text
|
|
|
|
var doc5 = Document.parse("<div><span><a>Link</a></span></div>")
|
|
System.print(doc5.querySelector("a").textContent) // expect: Link
|