(input)
| 562 | var HTMLParser = canParseHTMLNatively() ? root.DOMParser : createHTMLParser(); |
| 563 | |
| 564 | function RootNode (input) { |
| 565 | var root; |
| 566 | if (typeof input === 'string') { |
| 567 | var doc = htmlParser().parseFromString( |
| 568 | // DOM parsers arrange elements in the <head> and <body>. |
| 569 | // Wrapping in a custom element ensures elements are reliably arranged in |
| 570 | // a single element. |
| 571 | '<x-turndown id="turndown-root">' + input + '</x-turndown>', |
| 572 | 'text/html' |
| 573 | ); |
| 574 | root = doc.getElementById('turndown-root'); |
| 575 | } else { |
| 576 | root = input.cloneNode(true); |
| 577 | } |
| 578 | collapseWhitespace({ |
| 579 | element: root, |
| 580 | isBlock: isBlock, |
| 581 | isVoid: isVoid |
| 582 | }); |
| 583 | |
| 584 | return root |
| 585 | } |
| 586 | |
| 587 | var _htmlParser; |
| 588 | function htmlParser () { |
nothing calls this directly
no test coverage detected