|
// retoor <retoor@molodetz.nl>
|
|
|
|
import "html" for Document
|
|
|
|
var doc = Document.parse("<div id='test'><p>Hello</p></div>")
|
|
|
|
var div = doc.querySelector("div")
|
|
var html = div.outerHTML
|
|
System.print(html.contains("<div")) // expect: true
|
|
System.print(html.contains("id=\"test\"") || html.contains("id='test'")) // expect: true
|
|
System.print(html.contains("</div>")) // expect: true
|
|
System.print(html.contains("<p>")) // expect: true
|
|
|
|
var p = doc.querySelector("p")
|
|
System.print(p.outerHTML.contains("<p>")) // expect: true
|
|
System.print(p.outerHTML.contains("Hello")) // expect: true
|
|
System.print(p.outerHTML.contains("</p>")) // expect: true
|
|
|
|
var selfClose = Document.parse("<br/>")
|
|
var br = selfClose.querySelector("br")
|
|
System.print(br != null) // expect: true
|
|
|