/// <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); }
/// <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); }
/// <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); }
/// <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); }
/// <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>&</c> character /// as <c>&amp;</c>. /// </summary> protected void WriteEncodedUrl(string url) { HtmlFormatterSlim.EscapeUrl(url, _target); }
private void WriteEncodedHtml(StringPart text) { HtmlFormatterSlim.EscapeHtml(text, _target); }