Пример #1
0
        /// <summary>
        /// Encodes the given text with HTML encoding (ampersand-encoding) and writes the result to the target writer.
        /// </summary>
        protected void WriteEncodedHtml(string text)
        {
            if (text == null)
            {
                return;
            }

            HtmlFormatterSlim.EscapeHtml(new StringPart(text, 0, text.Length), _target);
        }
Пример #2
0
        /// <summary>
        /// Encodes the given text with HTML encoding (ampersand-encoding) and writes the result to the target writer.
        /// </summary>
        protected void WriteEncodedHtml(StringContent text)
        {
            if (text == null)
            {
                return;
            }

            HtmlFormatterSlim.EscapeHtml(text, _target);
        }
Пример #3
0
 /// <summary>
 /// Writes a <c>data-sourcepos="start-end"</c> attribute to the target writer.
 /// This method should only be called if <see cref="CommonMarkSettings.TrackSourcePosition"/> is set to <see langword="true"/>.
 /// Note that the attribute is preceded (but not succeeded) by a single space.
 /// </summary>
 protected void WritePositionAttribute(Inline inline)
 {
     HtmlFormatterSlim.PrintPosition(_target, inline);
 }
Пример #4
0
 /// <summary>
 /// Writes a <c>data-sourcepos="start-end"</c> attribute to the target writer.
 /// This method should only be called if <see cref="CommonMarkSettings.TrackSourcePosition"/> is set to <see langword="true"/>.
 /// Note that the attribute is preceded (but not succeeded) by a single space.
 /// </summary>
 protected void WritePositionAttribute(Block block)
 {
     HtmlFormatterSlim.PrintPosition(_target, block);
 }
Пример #5
0
 /// <summary>
 /// Encodes the given text with URL encoding (percent-encoding) and writes the result to the target writer.
 /// Note that the result is intended to be written to HTML attribute so this also encodes <c>&amp;</c> character
 /// as <c>&amp;amp;</c>.
 /// </summary>
 protected void WriteEncodedUrl(string url)
 {
     HtmlFormatterSlim.EscapeUrl(url, _target);
 }
Пример #6
0
 private void WriteEncodedHtml(StringPart text)
 {
     HtmlFormatterSlim.EscapeHtml(text, _target);
 }