private IProducerConsumer CreateChain(ConverterInput input, ConverterOutput output, IProgressMonitor progressMonitor) { base.Locked = true; HtmlInjection htmlInjection = null; //if (this.injectHead != null || this.injectTail != null) //{ // htmlInjection = new HtmlInjection(this.injectHead, this.injectTail, this.injectionFormat, this.filterHtml, null, base.TestBoundaryConditions, null, progressMonitor); // this.normalizeInputHtml = true; //} if (this.filterHtml || this.outputFragment)// || this.htmlCallback != null) { this.normalizeInputHtml = true; } IHtmlParser parser2; if (this.normalizeInputHtml) { HtmlParser parser = new HtmlParser(input, this.detectEncodingFromMetaTag, false, this.testMaxTokenRuns, this.testMaxHtmlTagAttributes, base.TestBoundaryConditions); parser2 = new HtmlNormalizingParser(parser, htmlInjection, false, this.testMaxHtmlNormalizerNesting, base.TestBoundaryConditions, null, this.testNormalizerTraceShowTokenNum, 0); } else { parser2 = new HtmlParser(input, this.detectEncodingFromMetaTag, false, this.testMaxTokenRuns, this.testMaxHtmlTagAttributes, base.TestBoundaryConditions); } HtmlWriter writer = new HtmlWriter(output, this.filterHtml, this.normalizeInputHtml); return(new HtmlToHtmlConverter(parser2, writer, false, this.outputFragment, this.filterHtml, null, this.testTruncateForCallback, htmlInjection != null && htmlInjection.HaveTail, null, this.testTraceShowTokenNum, 0, this.smallCssBlockThreshold, false, progressMonitor)); }
protected virtual void Dispose(bool disposing) { if (disposing) { if (output != null) { if (!copyPending) { Flush(); } if (output != null) { ((IDisposable)output).Dispose(); } } GC.SuppressFinalize(this); } output = null; }
internal HtmlWriter(ConverterOutput output, bool filterHtml, bool autoNewLines) { this.output = output; this.filterHtml = filterHtml; this.autoNewLines = autoNewLines; }