parser: Use strings.Contains instead of strings.Index
authorbogem <albertnigma@gmail.com>
Tue, 30 Aug 2016 17:30:33 +0000 (22:30 +0500)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Sun, 11 Sep 2016 10:23:15 +0000 (12:23 +0200)
Closes #2400

parser/page.go

index ed3f640107c8e726a54235bb1cf3aa87ed17bf2c..57b2d30450fc03a7fb1be40690921688a1865317 100644 (file)
@@ -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
        }