mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
update(html-minifier): continueOnParserError and version bump (#45594)
- `continueOnParseError` added: https://github.com/kangax/html-minifier/pull/1004/files - version 4 bump (no breaking changes): https://github.com/kangax/html-minifier/releases/tag/v4.0.0 - maintainer added Thanks!
This commit is contained in:
parent
6db8e019b5
commit
8b08f8668b
@ -2,6 +2,7 @@ import * as HTMLMinifier from 'html-minifier';
|
||||
const minify = HTMLMinifier.minify;
|
||||
|
||||
const result = minify('<p title="blah" id="moo">foo</p>', {
|
||||
removeAttributeQuotes: true
|
||||
removeAttributeQuotes: true,
|
||||
continueOnParseError: true,
|
||||
});
|
||||
result; // '<p title=blah id=moo>foo</p>'
|
||||
|
||||
9
types/html-minifier/index.d.ts
vendored
9
types/html-minifier/index.d.ts
vendored
@ -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 <https://github.com/tkrotoff>
|
||||
// Riku <https://github.com/rikuayanokozy>
|
||||
// Piotr Błażejewicz <https://github.com/peterblazejewicz>
|
||||
// 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. '<div flex?="{{mode != cover}}"></div>')
|
||||
customAttrAssign?: RegExp[];
|
||||
|
||||
Loading…
Reference in New Issue
Block a user