mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	Escape failed highlighted code (#12685)
Signed-off-by: Andrew Thornton <art27@cantab.net>
This commit is contained in:
		@@ -8,6 +8,7 @@ package highlight
 | 
			
		||||
import (
 | 
			
		||||
	"bufio"
 | 
			
		||||
	"bytes"
 | 
			
		||||
	gohtml "html"
 | 
			
		||||
	"path/filepath"
 | 
			
		||||
	"strings"
 | 
			
		||||
	"sync"
 | 
			
		||||
@@ -160,7 +161,7 @@ func plainText(code string, numLines int) map[int]string {
 | 
			
		||||
		if content == "" {
 | 
			
		||||
			content = "\n"
 | 
			
		||||
		}
 | 
			
		||||
		m[line] = content
 | 
			
		||||
		m[line] = gohtml.EscapeString(content)
 | 
			
		||||
	}
 | 
			
		||||
	return m
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user