public HtmlWriterToHtml(TextWriter writer, HtmlSettings settings = null) { this.writer = writer ?? throw new ArgumentNullException(nameof(writer)); this.writer.NewLine = "\n"; this.settings = settings; this.isFirstWrite = true; }
public HtmlMinifier(HtmlDocument html, HtmlSettings settings = null) { this.html = html ?? throw new ArgumentNullException(nameof(html)); this.settings = settings ?? new HtmlSettings(); pendingTexts = new List <HtmlText>(); Errors = new List <UglifyError>(); }
public HtmlWriterToHtml(TextWriter writer, HtmlSettings settings = null) { if (writer == null) { throw new ArgumentNullException(nameof(writer)); } Writer = writer; writer.NewLine = "\n"; this.settings = settings; }
/// <summary> /// Initializes a new instance of the <see cref="HtmlParser"/> class. /// </summary> /// <param name="text">The text.</param> /// <param name="sourceFileName">Name of the source file.</param> /// <param name="settings"></param> /// <exception cref="System.ArgumentNullException"></exception> public HtmlParser(string text, string sourceFileName = null, HtmlSettings settings = null) { this.text = text ?? throw new ArgumentNullException(nameof(text)); this.sourceFileName = sourceFileName; this.settings = settings ?? new HtmlSettings(); tempBuilder = new StringBuilder(); Errors = new List <UglifyError>(); position = -1; column = -1; stack = new List <HtmlElement>(); }
public HtmlMinifier(HtmlDocument html, HtmlSettings settings = null) { if (html == null) { throw new ArgumentNullException(nameof(html)); } this.settings = settings ?? new HtmlSettings(); attributeCssSettings = this.settings.CssSettings.Clone(); attributeCssSettings.CssType = CssType.DeclarationList; this.html = html; pendingTexts = new List <HtmlText>(); Errors = new List <UglifyError>(); }