MCPcopy Create free account
hub / github.com/deta/surf / minifyHTML

Function minifyHTML

packages/web-parser/src/utils.ts:25–40  ·  view source on GitHub ↗
(html: string, opts?: any)

Source from the content-addressed store, hash-verified

23}
24
25export const minifyHTML = (html: string, opts?: any) => {
26 return minify(html, {
27 collapseBooleanAttributes: true,
28 collapseWhitespace: true,
29 collapseInlineTagWhitespace: true,
30 continueOnParseError: true,
31 removeComments: true,
32 removeEmptyAttributes: true,
33 removeEmptyElements: true,
34 removeOptionalTags: true,
35 removeRedundantAttributes: true,
36 removeScriptTypeAttributes: true,
37 removeStyleLinkTypeAttributes: true,
38 ...opts
39 })
40}

Callers 2

getPageMethod · 0.90
getContentMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected