From 6f5e22e764283262ae8c6519bb030766db0fd35b Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Sun, 6 Apr 2025 09:58:02 +0800 Subject: Add more documentation comments --- forged/internal/render/chroma.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'forged/internal/render') diff --git a/forged/internal/render/chroma.go b/forged/internal/render/chroma.go index c1a1869..64bfde0 100644 --- a/forged/internal/render/chroma.go +++ b/forged/internal/render/chroma.go @@ -12,6 +12,9 @@ import ( chromaStyles "github.com/alecthomas/chroma/v2/styles" ) +// Highlight returns HTML with syntax highlighting for the given file content, +// using Chroma. The lexer is selected based on the filename. +// If tokenization or formatting fails, a fallback
 block is returned with the error.
 func Highlight(filename, content string) template.HTML {
 	lexer := chromaLexers.Match(filename)
 	if lexer == nil {
-- 
cgit v1.2.3