Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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 <c>true</c>.
 /// Note that the attribute is preceded (but not succeeded) by a single space.
 /// </summary>
 protected void WritePositionAttribute(Inline inline)
 {
     HtmlFormatterSlim.PrintPosition(_target, inline);
 }
Ejemplo n.º 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 <c>true</c>.
 /// Note that the attribute is preceded (but not succeeded) by a single space.
 /// </summary>
 protected void WritePositionAttribute(Block block)
 {
     HtmlFormatterSlim.PrintPosition(_target, block);
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 6
0
 private void WriteEncodedHtml(StringPart text)
 {
     HtmlFormatterSlim.EscapeHtml(text, _target);
 }