コード例 #1
0
		public HtmlFormatterFilter(HtmlFilterSettings settings, 
			HtmlElementRule container, HtmlElementBuilder element, 
			StringWriter output)
			: base(TextReader.Null, output, settings)
		{
			_contents = output.GetStringBuilder();
			_container = container;
			_element = element;
		}
コード例 #2
0
 public HtmlFormatterFilter(HtmlFilterSettings settings,
                            HtmlElementRule container, HtmlElementBuilder element,
                            StringWriter output)
     : base(TextReader.Null, output, settings)
 {
     _contents  = output.GetStringBuilder();
     _container = container;
     _element   = element;
 }
コード例 #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);
        }
コード例 #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);
		}
コード例 #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);
        }
コード例 #6
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();
 }
コード例 #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;
		}
コード例 #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();
 }