public HtmlFormatterFilter(HtmlFilterSettings settings, 
			HtmlElementRule container, HtmlElementBuilder element, 
			StringWriter output)
			: base(TextReader.Null, output, settings)
		{
			_contents = output.GetStringBuilder();
			_container = container;
			_element = element;
		}
 public HtmlFormatterFilter(HtmlFilterSettings settings,
                            HtmlElementRule container, HtmlElementBuilder element,
                            StringWriter output)
     : base(TextReader.Null, output, settings)
 {
     _contents  = output.GetStringBuilder();
     _container = container;
     _element   = element;
 }
Esempio n. 3
0
        /// <summary>
        /// Initializes a new instance of the
        /// <see cref="Radischevo.Wahha.Web.Text.HtmlFilter"/> class.
        /// </summary>
        public HtmlFilter(TextReader reader, TextWriter writer,
                          HtmlFilterSettings settings)
        {
            Precondition.Require(reader, () => Error.ArgumentNull("reader"));
            Precondition.Require(writer, () => Error.ArgumentNull("writer"));

            _settings = settings ?? new HtmlFilterSettings(
                HtmlFilteringMode.AllowByDefault);
            _reader = CreateHtmlReader(reader, settings);
            _writer = new XmlTextWriter(writer);
        }
Esempio n. 4
0
		/// <summary>
		/// Initializes a new instance of the 
		/// <see cref="Radischevo.Wahha.Web.Text.HtmlFilter"/> class.
		/// </summary>
		public HtmlFilter(TextReader reader, TextWriter writer,
			HtmlFilterSettings settings)
		{
			Precondition.Require(reader, () => Error.ArgumentNull("reader"));
			Precondition.Require(writer, () => Error.ArgumentNull("writer"));

			_settings = settings ?? new HtmlFilterSettings(
				HtmlFilteringMode.AllowByDefault);
			_reader = CreateHtmlReader(reader, settings);
			_writer = new XmlTextWriter(writer);
		}
Esempio n. 5
0
        private static XmlReader CreateHtmlReader(TextReader reader, HtmlFilterSettings settings)
        {
            SgmlReader sgml = new SgmlReader();

            sgml.DocType            = "html";
            sgml.WhitespaceHandling = (settings.PreserveWhitespace) ?
                                      WhitespaceHandling.All : WhitespaceHandling.None;
            sgml.CaseFolding = CaseFolding.ToLower;
            sgml.InputStream = reader;

            return(sgml);
        }
 /// <summary>
 /// Initializes a new instance of the 
 /// <see cref="Radischevo.Wahha.Web.Text.HtmlProcessor"/> class.
 /// </summary>
 public HtmlProcessor()
 {
     _filter = new HtmlFilterSettings(
         HtmlFilteringMode.AllowByDefault);
     _typographics = new HtmlTypographerSettings();
 }
Esempio n. 7
0
		private static XmlReader CreateHtmlReader(TextReader reader, HtmlFilterSettings settings)
		{
			SgmlReader sgml = new SgmlReader();
			sgml.DocType = "html";
			sgml.WhitespaceHandling = (settings.PreserveWhitespace) ?
				WhitespaceHandling.All : WhitespaceHandling.None;
			sgml.CaseFolding = CaseFolding.ToLower;
			sgml.InputStream = reader;

			return sgml;
		}
Esempio n. 8
0
 /// <summary>
 /// Initializes a new instance of the
 /// <see cref="Radischevo.Wahha.Web.Text.HtmlProcessor"/> class.
 /// </summary>
 public HtmlProcessor()
 {
     _filter = new HtmlFilterSettings(
         HtmlFilteringMode.AllowByDefault);
     _typographics = new HtmlTypographerSettings();
 }