"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.serializeOuter = exports.serialize = void 0; const html_js_1 = require("../common/html.js"); const escape_js_1 = require("entities/lib/escape.js"); const default_js_1 = require("../tree-adapters/default.js"); // Sets const VOID_ELEMENTS = new Set([ html_js_1.TAG_NAMES.AREA, html_js_1.TAG_NAMES.BASE, html_js_1.TAG_NAMES.BASEFONT, html_js_1.TAG_NAMES.BGSOUND, html_js_1.TAG_NAMES.BR, html_js_1.TAG_NAMES.COL, html_js_1.TAG_NAMES.EMBED, html_js_1.TAG_NAMES.FRAME, html_js_1.TAG_NAMES.HR, html_js_1.TAG_NAMES.IMG, html_js_1.TAG_NAMES.INPUT, html_js_1.TAG_NAMES.KEYGEN, html_js_1.TAG_NAMES.LINK, html_js_1.TAG_NAMES.META, html_js_1.TAG_NAMES.PARAM, html_js_1.TAG_NAMES.SOURCE, html_js_1.TAG_NAMES.TRACK, html_js_1.TAG_NAMES.WBR, ]); function isVoidElement(node, options) { return (options.treeAdapter.isElementNode(node) && options.treeAdapter.getNamespaceURI(node) === html_js_1.NS.HTML && VOID_ELEMENTS.has(options.treeAdapter.getTagName(node))); } const defaultOpts = { treeAdapter: default_js_1.defaultTreeAdapter, scriptingEnabled: true }; /** * Serializes an AST node to an HTML string. * * @example * * ```js * const parse5 = require('parse5'); * * const document = parse5.parse('
Hi there!