TextMateHighlighter
Pennington.Highlighting
Provides syntax highlighting for code blocks using TextMate grammars. Implements ICodeHighlighter with priority 50.
Properties
Priorityint- Priority — higher wins when multiple highlighters support a language.
SupportedLanguagesIReadOnlySet<string>- Languages this highlighter handles (e.g., "csharp", "python").
Constructors
TextMateHighlighter
#public TextMateHighlighter(TextMateLanguageRegistry languageRegistry)
Initializes the highlighter with a TextMate grammar registry shared across instances.
Parameters
languageRegistryTextMateLanguageRegistry
Methods
Highlight
#public string Highlight(string code, string language)
Highlight code. Returns HTML with spans.
Parameters
codestringlanguagestring
Returns
stringPennington.Highlighting.TextMateHighlighter
namespace Pennington.Highlighting;
/// Provides syntax highlighting for code blocks using TextMate grammars. Implements ICodeHighlighter with priority 50.
public class TextMateHighlighter
{
/// 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; }
/// Initializes the highlighter with a TextMate grammar registry shared across instances.
public TextMateHighlighter(TextMateLanguageRegistry languageRegistry)
;
}