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

Function canParseHtmlNatively

static/to-markdown/lib/html-parser.js:11–25  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

9 */
10
11function canParseHtmlNatively () {
12 var Parser = _window.DOMParser
13 var canParse = false
14
15 // Adapted from https://gist.github.com/1129031
16 // Firefox/Opera/IE throw errors on unsupported types
17 try {
18 // WebKit returns null on unsupported types
19 if (new Parser().parseFromString('', 'text/html')) {
20 canParse = true
21 }
22 } catch (e) {}
23
24 return canParse
25}
26
27function createHtmlParser () {
28 var Parser = function () {}

Callers 1

html-parser.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected