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

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

Priority int
Priority — higher runs first.

Methods

TryProcess

#
public CodeBlockPreprocessResult TryProcess(string code, string languageId)

Attempts to preprocess a code block. Returns a result if handled, or null to pass through.

Parameters

code string
languageId string

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.
    
public int Priority { get; }
/// Attempts to preprocess a code block. Returns a result if handled, or null to pass through.
public CodeBlockPreprocessResult TryProcess(string code, string languageId)
; }