@@ -105,13 +105,14 @@ anyHtmlTag = try $ do
105105 char '<'
106106 spaces
107107 tag <- many1 alphaNum
108− attribs <- htmlAttributes
108+ attribs <- many htmlAttribute
109109 spaces
110110 ender <- option "" (string "/")
111111 let ender' = if null ender then "" else " /"
112112 spaces
113113 char '>'
114− return $ "<" ++ tag ++ attribs ++ ender' ++ ">"
114+ return $ "<" ++ tag ++
115+ concatMap (\(_, _, raw) -> (' ':raw)) attribs ++ ender' ++ ">"
115116
116117anyHtmlEndTag = try $ do
117118 char '<'
@@ -141,19 +142,13 @@ quoted quoteChar = do
141142 (many (noneOf [quoteChar]))
142143 return (result, [quoteChar])
143144
144−htmlAttributes = do
145− attrList <- many htmlAttribute
146− return $ concatMap (\(name, content, raw) -> raw) attrList
147−
148145htmlAttribute = htmlRegularAttribute <|> htmlMinimizedAttribute
149146
150147-- minimized boolean attribute
151148htmlMinimizedAttribute = try $ do
152149 many1 space
153150 name <- many1 (choice [letter, oneOf ".-_:"])
154− notFollowedBy (spaces >> char '=')
155− let content = name
156− return (name, content, (" " ++ name))
151+ return (name, name, name)
157152
158153htmlRegularAttribute = try $ do
159154 many1 space
@@ -167,7 +162,7 @@ htmlRegularAttribute = try $ do
167162 a <- many (alphaNum <|> (oneOf "-._:"))
168163 return (a,"")) ]
169164 return (name, content,
170− (" " ++ name ++ "=" ++ quoteStr ++ content ++ quoteStr))
165+ (name ++ "=" ++ quoteStr ++ content ++ quoteStr))
171166
172167-- | Parse an end tag of type 'tag'
173168htmlEndTag tag = try $ do