@@ -199,10 +199,12 @@ pHeader = try $ do
199199 let bodyTitle = TagOpen tagtype attr ~== TagOpen "h1" [("class","title")]
200200 let level = read (drop 1 tagtype)
201201 contents <- liftM concat $ manyTill inline (pCloses tagtype <|> eof)
202+ let ident = maybe "" id $ lookup "id" attr
203+ let classes = maybe [] words $ lookup "class" attr
204+ let keyvals = [(k,v) | (k,v) <- attr, k /= "class", k /= "id"]
202205 return $ if bodyTitle
203206 then [] -- skip a representation of the title in the body
204− else [Header level (fromAttrib "id" $
205− TagOpen tagtype attr, [], []) $
207+ else [Header level (ident, classes, keyvals) $
206208 normalizeSpaces contents]
207209
208210pHrule :: TagParser [Block]