Class DiffRenderer
Renders unified diff output with red/green ANSI backgrounds — the same visual style used by git diff and similar tools. No markdown processing is applied; diffs are output verbatim with color.
public static class DiffRenderer
- Inheritance
-
DiffRenderer
- Inherited Members
Methods
IsDiff(string)
Returns true when text looks like a unified diff.
Accepts optional preamble lines (e.g. diff --git, index …)
before the --- / +++ markers so that full git diff
output is detected correctly.
public static bool IsDiff(string text)
Parameters
textstring
Returns
Render(string)
Render a unified diff with colored line prefixes. Added lines (+) → green; removed lines (−) → red; hunk headers (@@) → cyan; context → default.
public static void Render(string diff)
Parameters
diffstring