Skip to content

Commit 17b96f4

Browse files
committed
hlint suggestions added
1 parent a09ada4 commit 17b96f4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Parser.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module Parser (parseMarkdown, isTableLine) where
33
import Crypto.Hash (Digest, MD5, hash)
44
import Data.Char (isAlpha, isAlphaNum, isDigit, isSpace)
55
import Data.List (groupBy)
6-
import Data.Maybe (fromMaybe)
6+
import Data.Maybe (fromMaybe, isJust)
77
import Data.Text (Text, break)
88
import qualified Data.Text as T
99
import Data.Text.Encoding (encodeUtf8)
@@ -152,7 +152,7 @@ isOrderedListLine line =
152152
case T.uncons line of
153153
Just (c, rest) | isDigit c ->
154154
case T.stripPrefix (T.takeWhile isDigit line) line of
155-
Just rest' -> T.stripPrefix (T.pack ". ") rest' /= Nothing
155+
Just rest' -> isJust (T.stripPrefix (T.pack ". ") rest')
156156
Nothing -> False
157157
_ -> False
158158

@@ -528,7 +528,7 @@ isCodeBlockStart line =
528528
parseCodeBlock :: [Text] -> (MDElement, [Text])
529529
parseCodeBlock (firstLine : rest) =
530530
let lang = T.strip $ T.drop 3 $ T.stripStart firstLine
531-
(codeLines, remainingLines) = span (not . isCodeBlockStart) rest
531+
(codeLines, remainingLines) = Prelude.break isCodeBlockStart rest
532532
codeBlockContent = T.unlines codeLines
533533
in (CodeBlock codeBlockContent, drop 1 remainingLines)
534534
parseCodeBlock _ = (CodeBlock T.empty, [])

0 commit comments

Comments
 (0)