isPreformatted method
Whether node sits inside a <pre> element, where the HTML
specification preserves whitespace.
Implementation
bool isPreformatted(dom.Node node) {
for (var parent = node.parent; parent != null; parent = parent.parent) {
if (parent.localName == 'pre') return true;
}
return false;
}