Class HtmlSink
<pre class="tigercli"> + <span> (and optionally <a>) markup.
This sink renders the CliCharStyle it receives; it does not reconstruct the
original semantic token (e.g. [Heading]) once it has been resolved to a concrete style.
Text decorations and the link role map to stable CSS classes (tc-bold, tc-italic,
tc-underline, tc-link); foreground/background colours map to a deterministic inline
#RRGGBB hex derived from CliColorPalette (the 256-colour palette has no stable
CSS class names). Text content is HTML-escaped, attribute values are attribute-escaped, and
whitespace/line breaks are preserved via the <pre> wrapper. No ANSI is ever emitted.
Like the ANSI sink, link text is always written visibly and copyably. In
Anchor a non-empty, safe HyperlinkTarget
is additionally wrapped in <a href="…">; an empty or unsafe target (control characters,
or a javascript:/vbscript:/data: scheme) falls back to a styled span.
public sealed class HtmlSink : ICliRenderSink
- Inheritance
-
HtmlSink
- Implements
- Inherited Members
Constructors
HtmlSink(TextWriter, HtmlSinkOptions?)
writer. When options is
null, the conservative defaults (HtmlSinkOptions) are used.public HtmlSink(TextWriter writer, HtmlSinkOptions? options = null)
Parameters
writerTextWriteroptionsHtmlSinkOptions
Properties
MaxHeight
null when unbounded.public int? MaxHeight { get; }
Property Value
- int?
MaxWidth
null when unbounded.public int? MaxWidth { get; }
Property Value
- int?
SoftMaxHeight
null when unbounded.public int? SoftMaxHeight { get; }
Property Value
- int?
SoftMaxWidth
public int? SoftMaxWidth { get; }
Property Value
- int?
WindowTitle
public string? WindowTitle { get; }
Property Value
Methods
Flush()
public void Flush()
NewLine()
public void NewLine()
Reset()
public void Reset()
SetWindowTitle(string)
public void SetWindowTitle(string title)
Parameters
titlestring- The window title to capture.
Write(CliTextSegment)
public void Write(CliTextSegment segment)
Parameters
segmentCliTextSegment- The styled text segment to write.