1
1
mirror of https://github.com/github/semantic.git synced 2024-12-18 12:21:57 +03:00

Don’t make empty text/etc nodes.

This commit is contained in:
Rob Rix 2015-12-10 16:46:38 -05:00
parent 60b9e630a8
commit 7f77b39b78

View File

@ -173,6 +173,7 @@ contextRows childIndices previousIndices sources = zipWithMaybe rowFromMaybeRows
elementAndBreak :: (String -> HTML) -> String -> [HTML]
elementAndBreak _ "" = []
elementAndBreak _ "\n" = [ Break ]
elementAndBreak constructor x | '\n' <- last x = [ constructor $ init x, Break ]
elementAndBreak constructor x = [ constructor x ]