git.iko.soy/typeable/pandoc
on master help sign in
Muse reader: simplify lchop
fedf1f2Alexander Krotov
src/Text/Pandoc/Readers/Muse.hs+2−3
@@ -145,9 +145,8 @@ commonPrefix (x:xs) (y:ys)
145
145
146-- | Trim up to one newline from the beginning of the string.
146-- | Trim up to one newline from the beginning of the string.
147lchop :: String -> String
147lchop :: String -> String
148−lchop s = case s of
148+lchop ('\n':xs) = xs
149− '\n':ss -> ss
149+lchop s = s
150− _ -> s
151
150
152-- | Trim up to one newline from the end of the string.
151-- | Trim up to one newline from the end of the string.
153rchop :: String -> String
152rchop :: String -> String