public GenericHtmlMinifier(GenericHtmlMinificationSettings settings = null,
ICssMinifier cssMinifier = null, IJsMinifier jsMinifier = null, ILogger logger = null)
{
_settings = settings ?? new GenericHtmlMinificationSettings();
_logger = logger ?? new NullLogger();
_cssMinifier = cssMinifier ?? new KristensenCssMinifier();
_jsMinifier = jsMinifier ?? new CrockfordJsMinifier();
_htmlParser = new HtmlParser(new HtmlParsingHandlers
{
XmlDeclaration = XmlDeclarationHandler,
Doctype = DoctypeHandler,
Comment = CommentHandler,
IfConditionalComment = IfConditionalCommentHandler,
EndIfConditionalComment = EndIfConditionalCommentHandler,
StartTag = StartTagHandler,
EndTag = EndTagHandler,
Text = TextHandler,
EmbeddedCode = EmbeddedCodeHandler,
TemplateTag = TemplateTagHandler,
IgnoredFragment = IgnoredFragmentHandler
});
_buffer = new List<string>();
_errors = new List<MinificationErrorInfo>();
_warnings = new List<MinificationErrorInfo>();
_tagsWithNotRemovableWhitespaceQueue = new Queue<string>();
_currentNodeType = HtmlNodeType.Unknown;
_currentTag = null;
_currentText = string.Empty;
ISet<string> customAngularDirectivesWithExpressions = _settings.CustomAngularDirectiveCollection;
_angularDirectivesWithExpressions = customAngularDirectivesWithExpressions.Count > 0 ?
Utils.UnionHashSets(_builtinAngularDirectivesWithExpressions, customAngularDirectivesWithExpressions)
:
_builtinAngularDirectivesWithExpressions
;
}