// HTML Formatter
// https://github.com/uznam8x/html-formatter
// MIT License
const single = [
'br', 'hr', 'img', 'input', 'meta', 'link',
'col', 'base', 'param', 'track', 'source', 'wbr',
'command', 'keygen', 'area', 'embed', 'menuitem'
];
const closing = function(el) {
el = el.replace(/<([a-zA-Z\-0-9]+)[^>]*>/g, function(match, capture) {
if (single.indexOf(capture) > -1) {
return (match.substring(0, match.length - 1) + ' />').replace(/\/\s\//g, '/');
}
return match.replace(/[\s]?\/>/g, '>' + capture + '>');
});
return el;
};
const entity = function(el) {
el = el.replace(/(');
el = el.replace(/