1
1
mirror of https://github.com/github/semantic.git synced 2024-12-19 12:51:52 +03:00

textElements calls out to elementAndBreak.

This commit is contained in:
Rob Rix 2015-12-10 14:17:51 -05:00
parent 43a20d00bd
commit 6d2a89b55a

View File

@ -173,11 +173,8 @@ elementAndBreak constructor x | '\n' <- last x = [ constructor $ init x, Break ]
elementAndBreak constructor x = [ constructor x ]
textElements :: Range -> String -> [HTML]
textElements range source = textAndBreak =<< actualLines s
textElements range source = (elementAndBreak Text) =<< actualLines s
where s = substring range source
textAndBreak "" = []
textAndBreak x | '\n' <- last x = [ Text $ init x, Break ]
textAndBreak x = [ Text x ]
starts :: (Range , Range) -> (Int, Int)
starts (left, right) = (start left, start right)