lib/service/html-parser.js
function parseHtml(html, sourceCodeStore) {
    const isFragment = !/^\s*<(!doctype|html|head|body|!--)/iu.test(html)
    const document = (isFragment ? parse5.parseFragment : parse5.parse)(html, {
        sourceCodeLocationInfo: true,
    })

    return parse5NodeToToken(document, null, html, sourceCodeStore, html.length)
}
function parseHtml(html, sourceCodeStore) {
    const isFragment = !/^\s*<(!doctype|html|head|body|!--)/iu.test(html)
    const document = (isFragment ? parse5.parseFragment : parse5.parse)(html, {
        sourceCodeLocationInfo: true,
    })

    return parse5NodeToToken(document, null, html, sourceCodeStore, html.length)
}
function parseHtml ( html , sourceCodeStore ) { const isFragment = ! / ^\s*<(!doctype|html|head|body|!--) / iu . test ( html ) const document = ( isFragment ? parse5 . parseFragment : parse5 . parse ) ( html , { sourceCodeLocationInfo : true , } ) return parse5NodeToToken ( document , null , html , sourceCodeStore , html . length ) }
Parse the given html.
@param {string} html The html source code to parse.
@param {SourceCodeStore} sourceCodeStore The sourceCodeStore.
@returns {object} The parsing result.
Parse the given html .