feed 1.1.0.0 → 1.2.0.0
raw patch · 8 files changed
+17/−9 lines, 8 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
- Text.Atom.Feed: HTMLContent :: Text -> EntryContent
+ Text.Atom.Feed: HTMLContent :: Element -> EntryContent
Files
- CHANGELOG.md +4/−0
- README.lhs +1/−1
- README.md +1/−1
- feed.cabal +3/−3
- src/Text/Atom/Feed.hs +1/−1
- src/Text/Atom/Feed/Export.hs +1/−1
- src/Text/Atom/Feed/Import.hs +5/−1
- tests/Example/CreateAtom.hs +1/−1
CHANGELOG.md view
@@ -1,3 +1,7 @@+## 1.2.0.0++Updated `EntryContent`'s `HTMLContent` to wrap an `XML.Element` instead of `Text`. Thanks to Jake Keuhlen.+ ## 1.1.0.0 * `parseFeedFromFile` now returns `IO (Maybe Feed)` instead of `IO Feed` to distinguish IO exceptions from parse failures. Thanks to Jake Keuhlen.
README.lhs view
@@ -106,7 +106,7 @@ date) { Atom.entryAuthors = [Atom.nullPerson {Atom.personName = "J. Smith"}] , Atom.entryLinks = [Atom.nullLink url]- , Atom.entryContent = Just (Atom.HTMLContent content)+ , Atom.entryContent = Just (Atom.TextContent content) } ```
README.md view
@@ -106,7 +106,7 @@ date) { Atom.entryAuthors = [Atom.nullPerson {Atom.personName = "J. Smith"}] , Atom.entryLinks = [Atom.nullLink url]- , Atom.entryContent = Just (Atom.HTMLContent content)+ , Atom.entryContent = Just (Atom.TextContent content) } ```
feed.cabal view
@@ -1,5 +1,5 @@ name: feed-version: 1.1.0.0+version: 1.2.0.0 license: BSD3 license-file: LICENSE category: Text@@ -86,7 +86,7 @@ , time-locale-compat == 0.1.* , utf8-string < 1.1 , xml-types >= 0.3.6 && < 0.4- , xml-conduit >= 1.3 && < 1.9+ , xml-conduit >= 1.3 && < 1.10 test-suite tests ghc-options: -Wall@@ -118,7 +118,7 @@ , text < 1.3 , time < 1.9 , xml-types >= 0.3.6 && < 0.4- , xml-conduit >= 1.3 && < 1.9+ , xml-conduit >= 1.3 && < 1.10 test-suite readme ghc-options: -Wall -pgmL markdown-unlit
src/Text/Atom/Feed.hs view
@@ -93,7 +93,7 @@ data EntryContent = TextContent Text- | HTMLContent Text+ | HTMLContent XML.Element | XHTMLContent XML.Element | MixedContent (Maybe Text) [XML.Node]
src/Text/Atom/Feed/Export.hs view
@@ -173,7 +173,7 @@ xmlContent cont = case cont of TextContent t -> (atomLeaf "content" t) {elementAttributes = [atomAttr "type" "text"]}- HTMLContent t -> (atomLeaf "content" t) {elementAttributes = [atomAttr "type" "html"]}+ HTMLContent x -> (atomNode "content" [NodeElement x]) {elementAttributes = [atomAttr "type" "html"]} XHTMLContent x -> (atomNode "content" [NodeElement x]) {elementAttributes = [atomAttr "type" "xhtml"]} MixedContent mbTy cs -> (atomNode "content" cs) {elementAttributes = mb (atomAttr "type") mbTy}
src/Text/Atom/Feed/Import.hs view
@@ -253,7 +253,11 @@ case pAttr "type" e of Nothing -> return (TextContent (elementTexts e)) Just "text" -> return (TextContent (elementTexts e))- Just "html" -> return (HTMLContent (elementTexts e))+ Just "html" -> + case children e of+ [] -> return (TextContent "")+ [c] -> return (HTMLContent c)+ _ -> Nothing Just "xhtml" -> case children e of [] -> return (TextContent "")
tests/Example/CreateAtom.hs view
@@ -35,7 +35,7 @@ date) { Atom.entryAuthors = [Atom.nullPerson {Atom.personName = "J. Smith"}] , Atom.entryLinks = [Atom.nullLink url]- , Atom.entryContent = Just (Atom.HTMLContent content)+ , Atom.entryContent = Just (Atom.TextContent content) } feed :: [Post] -> Atom.Feed