Beispiel #1
0
        protected virtual void WriteText(HtmlElementRule rule, string text)
        {
            if ((rule.Options & HtmlElementOptions.UseTypography) ==
                HtmlElementOptions.UseTypography)
            {
                HtmlTypographer typographer = new HtmlTypographer(text, Typographics, _lastState);
                typographer.Formatter = (element, mode) => FormatElement(rule, element, mode);

                bool lastValue = typographer.Settings.InsertNoBreakTags;
                if (String.Equals(rule.Name, "nobr", StringComparison.OrdinalIgnoreCase))
                {
                    typographer.Settings.InsertNoBreakTags = false;
                }

                _writer.WriteRaw(typographer.Execute());

                typographer.Settings.InsertNoBreakTags = lastValue;
                _lastState = typographer.State;
            }
            else
            {
                _writer.WriteString(text);
            }
        }
		protected virtual void WriteText(HtmlElementRule rule, string text)
		{
			if ((rule.Options & HtmlElementOptions.UseTypography) == 
				HtmlElementOptions.UseTypography)
			{
				HtmlTypographer typographer = new HtmlTypographer(text, Typographics, _lastState);
				typographer.Formatter = (element, mode) => FormatElement(rule, element, mode);

				bool lastValue = typographer.Settings.InsertNoBreakTags;
				if (String.Equals(rule.Name, "nobr", StringComparison.OrdinalIgnoreCase))
					typographer.Settings.InsertNoBreakTags = false;

				_writer.WriteRaw(typographer.Execute());

				typographer.Settings.InsertNoBreakTags = lastValue;
				_lastState = typographer.State;
			}
			else
				_writer.WriteString(text);
		}