ShellHighlighter Pennington.Highlighting
Provides syntax highlighting for shell/bash/batch commands. Implements ICodeHighlighter with priority 75 (higher than TextMate for shell languages).
Properties
Priorityint- Priority — higher wins when multiple highlighters support a language.
SupportedLanguagesSystem.Collections.Generic.IReadOnlySet<string>- Default:
new HashSet<string> { "bash", "shell", "sh" }Languages this highlighter handles (e.g., "csharp", "python").
Methods
Highlight
#public string Highlight(string code, string language);Highlight code. Returns HTML with spans.
Parameters
codestringlanguagestring
Returns
stringPennington.Highlighting.ShellHighlighter
namespace Pennington.Highlighting;
/// Provides syntax highlighting for shell/bash/batch commands. Implements ICodeHighlighter with priority 75 (higher than TextMate for shell languages).
public class ShellHighlighter
{
/// 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 => 75;
/// Languages this highlighter handles (e.g., "csharp", "python").
public IReadOnlySet<string> SupportedLanguages { get; } = new HashSet<string> { "bash", "shell", "sh" };
}