MCPcopy Create free account
hub / github.com/TruthHun/BookStack / canParseHTMLNatively

Function canParseHTMLNatively

static/word2md/turndown.js:510–524  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

508 */
509
510function canParseHTMLNatively () {
511 var Parser = root.DOMParser;
512 var canParse = false;
513
514 // Adapted from https://gist.github.com/1129031
515 // Firefox/Opera/IE throw errors on unsupported types
516 try {
517 // WebKit returns null on unsupported types
518 if (new Parser().parseFromString('', 'text/html')) {
519 canParse = true;
520 }
521 } catch (e) {}
522
523 return canParse
524}
525
526function createHTMLParser () {
527 var Parser = function () {};

Callers 1

turndown.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected