mirror of
https://codeberg.org/gothub/gothub
synced 2024-12-06 19:16:24 +01:00
remove extra info from diff-file shown
This commit is contained in:
@@ -14,6 +14,7 @@ import (
|
||||
"log"
|
||||
"net/http"
|
||||
"os"
|
||||
"regexp"
|
||||
"strings"
|
||||
)
|
||||
|
||||
@@ -55,6 +56,8 @@ func HandleCommit(c *fiber.Ctx) error {
|
||||
"error": err,
|
||||
})
|
||||
}
|
||||
re := regexp.MustCompile("\\A(?s).*?---(?-s).*\\n")
|
||||
file = re.ReplaceAllString(file, "---\n")
|
||||
lexer := lexers.Match("something.diff")
|
||||
if lexer == nil {
|
||||
lexer = lexers.Fallback
|
||||
|
||||
Reference in New Issue
Block a user