1
1
mirror of https://github.com/github/semantic.git synced 2024-12-26 08:25:19 +03:00

Concatenate HTML lines in Ul elements.

This commit is contained in:
Rob Rix 2015-12-02 16:36:47 -05:00
parent c3cd1edc7d
commit 8cbe16883d

View File

@ -63,7 +63,7 @@ splitTerm source = cata toElement where
splitHTMLIntoLines :: HTML -> [HTML] splitHTMLIntoLines :: HTML -> [HTML]
splitHTMLIntoLines (Text string) = Text <$> lines string splitHTMLIntoLines (Text string) = Text <$> lines string
splitHTMLIntoLines (Span className string) = Span className <$> lines string splitHTMLIntoLines (Span className string) = Span className <$> lines string
splitHTMLIntoLines (Ul className children) = Ul className . splitHTMLIntoLines <$> children splitHTMLIntoLines (Ul className children) = Ul className <$> foldr combineLines [[]] children
splitHTMLIntoLines (Dt string) = [ Dt string ] splitHTMLIntoLines (Dt string) = [ Dt string ]
combineLines :: HTML -> [[HTML]] -> [[HTML]] combineLines :: HTML -> [[HTML]] -> [[HTML]]