diff --git a/types/html-minifier/html-minifier-tests.ts b/types/html-minifier/html-minifier-tests.ts index 5cb2ffccf9..14847b1d34 100644 --- a/types/html-minifier/html-minifier-tests.ts +++ b/types/html-minifier/html-minifier-tests.ts @@ -2,6 +2,7 @@ import * as HTMLMinifier from 'html-minifier'; const minify = HTMLMinifier.minify; const result = minify('

foo

', { - removeAttributeQuotes: true + removeAttributeQuotes: true, + continueOnParseError: true, }); result; // '

foo

' diff --git a/types/html-minifier/index.d.ts b/types/html-minifier/index.d.ts index f49f533f9c..8feddc5b65 100644 --- a/types/html-minifier/index.d.ts +++ b/types/html-minifier/index.d.ts @@ -1,9 +1,9 @@ -// Type definitions for html-minifier 3.5 +// Type definitions for html-minifier 4.0 // Project: https://github.com/kangax/html-minifier, https://kangax.github.io/html-minifier // Definitions by: Tanguy Krotoff // Riku +// Piotr Błażejewicz // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.2 import * as UglifyJS from 'uglify-js'; import * as CleanCSS from 'clean-css'; @@ -29,6 +29,11 @@ export interface Options { // Always collapse to 1 space (never remove it entirely). Must be used in conjunction with collapseWhitespace=true conservativeCollapse?: boolean; + /** + * Handle parse errors instead of aborting + * @default false + */ + continueOnParseError?: boolean; // Arrays of regex'es that allow to support custom attribute assign expressions (e.g. '
') customAttrAssign?: RegExp[];