示例#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 is 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 is 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="PandocMarkSettings.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="PandocMarkSettings.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);
 }