shithub: hugo

Download patch

ref: 483cf19d5de05e8a83fd1be6934baa169c7fd7c8
parent: 7201042946dde78d5ea4fea9cb006fb4dded55c1
author: Iskander (Alex) Sharipov <[email protected]>
date: Sat Feb 2 05:19:12 EST 2019

common/herrors: Fix args order in strings.TrimPrefix

Old code always returned "." or "" (if filepath.Ext(filename) returned ".").
Now it properly trims the prefix.

Signed-off-by: Iskander Sharipov <[email protected]>

--- a/common/herrors/error_locator.go
+++ b/common/herrors/error_locator.go
@@ -173,7 +173,7 @@
 }
 
 func extNoDelimiter(filename string) string {
-	return strings.TrimPrefix(".", filepath.Ext(filename))
+	return strings.TrimPrefix(filepath.Ext(filename), ".")
 }
 
 func chromaLexerFromFilename(filename string) string {