1
1
mirror of https://github.com/github/semantic.git synced 2024-12-28 17:32:05 +03:00

Don’t wrap text nodes in dd nodes.

This commit is contained in:
Rob Rix 2015-12-07 16:22:26 -05:00
parent 83f9bab9f7
commit d7a77f217f

View File

@ -36,11 +36,15 @@ toLi :: HTML -> Markup
toLi (Text s) = string s
toLi e = li $ toMarkup e
toDd :: HTML -> Markup
toDd (Text s) = string s
toDd e = dd $ toMarkup e
instance ToMarkup HTML where
toMarkup (Text s) = string s
toMarkup (Span className s) = classifyMarkup className . span $ string s
toMarkup (Ul className children) = classifyMarkup className . ul $ mconcat (toLi <$> children)
toMarkup (Dl className children) = classifyMarkup className . dl $ mconcat (dd . toMarkup <$> children)
toMarkup (Dl className children) = classifyMarkup className . dl $ mconcat (toDd <$> children)
toMarkup (Dt key) = dt $ string key
split :: Diff a Info -> String -> String -> IO ByteString