This documentation is also published as Markdown for efficient machine reading: the whole site is indexed at /llms.txt, and every page has a clean Markdown copy under /_llms/. These are generated from the same source and cost far fewer tokens to read than this rendered HTML.

Skip to main content Skip to navigation

PlainTextHighlighter Pennington.Highlighting

Fallback highlighter — HTML-encodes code, no syntax highlighting.

Properties

Priority int
Priority — higher wins when multiple highlighters support a language.
SupportedLanguages IReadOnlySet<string>
Languages this highlighter handles (e.g., "csharp", "python").

Methods

Highlight

#
public string Highlight(string code, string language)

Highlight code. Returns HTML with spans.

Parameters

code string
language string

Returns

string

Pennington.Highlighting.PlainTextHighlighter

namespace Pennington.Highlighting;

/// Fallback highlighter — HTML-encodes code, no syntax highlighting.
public class PlainTextHighlighter
{
    /// Highlight code. Returns HTML with spans.
    
public string Highlight(string code, string language)
; /// Priority — higher wins when multiple highlighters support a language.
public int Priority { get; }
/// Languages this highlighter handles (e.g., "csharp", "python").
public IReadOnlySet<string> SupportedLanguages { get; }
}