hugo

Unnamed repository; edit this file 'description' to name the repository.

git clone git://git.shimmy1996.com/hugo.git
commit 4d1cb5000312a58bec0c98998f46f14dd6f1e21a
parent 798bf60c5638c68c7c96fb79fa534fe1b7688fef
Author: bogem <albertnigma@gmail.com>
Date:   Tue, 30 Aug 2016 22:30:33 +0500

parser: Use strings.Contains instead of strings.Index

Closes #2400

Diffstat:
Mparser/page.go | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/parser/page.go b/parser/page.go
@@ -181,7 +181,7 @@ func chompFrontmatterStartComment(r *bufio.Reader) (err error) {
 			return nil
 		}
 		testStr := strings.TrimSuffix(str[0:lineEnd], "\r")
-		if strings.Index(testStr, HTMLCommentEnd) != -1 {
+		if strings.Contains(testStr, HTMLCommentEnd) {
 			return nil
 		}
 		buf := make([]byte, lineEnd)
@@ -208,7 +208,7 @@ func chompFrontmatterEndComment(r *bufio.Reader) (err error) {
 		return nil
 	}
 	testStr := strings.TrimSuffix(str[0:lineEnd], "\r")
-	if strings.Index(testStr, HTMLCommentStart) != -1 {
+	if strings.Contains(testStr, HTMLCommentStart) {
 		return nil
 	}