xml-conduit 1.4.0.1 → 1.4.0.2
raw patch · 3 files changed
+9/−3 lines, 3 files
Files
- ChangeLog.md +5/−0
- Text/XML/Stream/Parse.hs +3/−2
- xml-conduit.cabal +1/−1
ChangeLog.md view
@@ -1,3 +1,8 @@+## 1.4.0.2++* Parse XML encoding case-insensitively+* Remove extra EOL when printing XmlException+ ## 1.4.0.1 * Handle CDATA in takeAllTreesContent [#88](https://github.com/snoyberg/xml/pull/88)
Text/XML/Stream/Parse.hs view
@@ -151,6 +151,7 @@ takeWhile1, try) import qualified Data.Attoparsec.Text as AT import Data.Conduit.Attoparsec (PositionRange, conduitParser)+import Data.List (intercalate) import Data.XML.Types (Content (..), Event (..), ExternalID (..), Instruction (..), Name (..))@@ -312,7 +313,7 @@ findEncoding [] = fallback findEncoding ((TName _ "encoding", [ContentText enc]):_) =- case enc of+ case TS.toLower enc of "iso-8859-1" -> complete CT.iso8859_1 "utf-8" -> complete CT.utf8 _ -> complete CT.utf8@@ -880,7 +881,7 @@ displayException (InvalidEntity msg (Just event)) = "Error while parsing XML entity " ++ show event ++ ": " ++ msg displayException (InvalidEntity msg _) = "Error while parsing XML entity: " ++ msg displayException (MissingAttribute msg) = "Missing required attribute: " ++ msg- displayException (UnparsedAttributes attrs) = show (length attrs) ++ " remaining unparsed attributes: \n" ++ unlines (show <$> attrs)+ displayException (UnparsedAttributes attrs) = show (length attrs) ++ " remaining unparsed attributes: \n" ++ intercalate "\n" (show <$> attrs) #endif -- | A monad for parsing attributes. By default, it requires you to deal with
xml-conduit.cabal view
@@ -1,5 +1,5 @@ name: xml-conduit-version: 1.4.0.1+version: 1.4.0.2 license: MIT license-file: LICENSE author: Michael Snoyman <michael@snoyman.com>, Aristid Breitkreuz <aristidb@googlemail.com>