ICodeBlockPreprocessor Pennington.Markdown.Extensions
Preprocesses fenced code blocks before normal highlighting. Implementations can intercept blocks with specific language modifiers (e.g., "csharp:xmldocid") and provide pre-highlighted HTML.
Properties
Priorityint- Priority — higher runs first.
Methods
TryProcess
#CodeBlockPreprocessResult? TryProcess(string code, string languageId);Attempts to preprocess a code block. Returns a result if handled, or null to pass through.
Parameters
codestringlanguageIdstring
Returns
CodeBlockPreprocessResult?Pennington.Markdown.Extensions.ICodeBlockPreprocessor
namespace Pennington.Markdown.Extensions;
/// Preprocesses fenced code blocks before normal highlighting. Implementations can intercept blocks with specific language modifiers (e.g., "csharp:xmldocid") and provide pre-highlighted HTML.
public interface ICodeBlockPreprocessor
{
/// Priority — higher runs first.
int Priority { get; }
/// Attempts to preprocess a code block. Returns a result if handled, or null to pass through.
CodeBlockPreprocessResult? TryProcess(string code, string languageId);
}