import init, { minify } from "https://wilsonl.in/minify-html/deno/0.11.1/index.js";
await init();
const encoder = new TextEncoder();
const decoder = new TextDecoder();
export async function minifyHTML(html: string, options?: Partial<MinifyHTMLOptions>) {
return decoder.decode(minify(encoder.encode(html), options));
}
export interface MinifyHTMLOptions {
do_not_minify_doctype: boolean;
ensure_spec_compliant_unquoted_attribute_values: boolean;
keep_closing_tags: boolean;
keep_html_and_head_opening_tags: boolean;
keep_spaces_between_attributes: boolean;
keep_comments: boolean;
minify_css: boolean;
minify_css_level_1: boolean;
minify_css_level_2: boolean;
minify_css_level_3: boolean;
minify_js: boolean;
remove_bangs: boolean;
remove_processing_instructions: boolean;
}