Skip to content
This repository has been archived by the owner on Apr 4, 2018. It is now read-only.

Commit

Permalink
lexString: keep processing after end-of-line comment
Browse files Browse the repository at this point in the history
  • Loading branch information
conal authored and conal committed Jul 18, 2016
1 parent d52204c commit fd2cdf8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Network/Gitit/Plugin/FixSymbols.hs
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,9 @@ substMap = Map.fromList $
-- Prelude's 'lex', but preserves spaces and end-of-line comments.
lexString :: String -> [String]
lexString "" = []
lexString (s@('-':'-':_)) = [s]
lexString (s@('-':'-':_)) = line : lexString rest
where
(line,rest) = break (== '\n') s
lexString (c:s') | c `elem` " \n\t" = [c] : lexString s'
lexString s | [(h,t)] <- lex s = h : lexString t
lexString (c:s') = [c] : lexString s'
Expand Down

0 comments on commit fd2cdf8

Please sign in to comment.