diff --git a/test/comment_parser.go b/test/comment_parser.go index 8e578d22..131f77b8 100644 --- a/test/comment_parser.go +++ b/test/comment_parser.go @@ -141,12 +141,12 @@ func Check(filename string) error { // TODO: how do we deal with multiline comments? if strings.HasPrefix(s, CommentMultilinePrefix) { - break // skip + break // skip to the end of this block } // skip the magic compiler comments if strings.HasPrefix(s, CommentGolangPrefix) { - break // skip + break // skip to the end of this block } if s != commentPrefixTrimmed && !strings.HasPrefix(s, CommentPrefix) { @@ -265,6 +265,9 @@ func IsNewStart(word string) bool { if IsNumberBullet(word) { return true } + if IsCodeBlock(word) { + return true + } return false } @@ -293,3 +296,11 @@ func IsNumberBullet(word string) bool { } return matched } + +// IsCodeBlock returns true if the word starts with a code block backtick. +func IsCodeBlock(word string) bool { + if strings.HasPrefix(word, "`") { + return true + } + return false +}