mirror of
https://github.com/github/semantic.git
synced 2024-12-25 07:55:12 +03:00
Add a function which appends an element onto the last line of a list of HTML lines.
This commit is contained in:
parent
0bf32bc50f
commit
5523a89eb5
@ -66,5 +66,9 @@ splitHTMLIntoLines (Span className string) = Span className <$> lines string
|
|||||||
splitHTMLIntoLines (Ul className children) = Ul className . splitHTMLIntoLines <$> children
|
splitHTMLIntoLines (Ul className children) = Ul className . splitHTMLIntoLines <$> children
|
||||||
splitHTMLIntoLines (Dt string) = [ Dt string ]
|
splitHTMLIntoLines (Dt string) = [ Dt string ]
|
||||||
|
|
||||||
|
appendOntoLastLine :: HTML -> [[HTML]] -> [[HTML]]
|
||||||
|
appendOntoLastLine line [ x ] = [ line : x ]
|
||||||
|
appendOntoLastLine line (x : xs) = x : appendOntoLastLine line xs
|
||||||
|
|
||||||
classify :: Set.Set Category -> Maybe ClassName
|
classify :: Set.Set Category -> Maybe ClassName
|
||||||
classify = foldr (const . Just) Nothing
|
classify = foldr (const . Just) Nothing
|
||||||
|
Loading…
Reference in New Issue
Block a user