X-Git-Url: http://gitweb.michael.orlitzky.com/?p=dead%2Flwn-epub.git;a=blobdiff_plain;f=src%2FLWN%2FPage.hs;h=ccc2590d64b0dddf94dcf85a62a650168549763d;hp=d4aeb3006cab8c331c76219a723d1a20baf6f623;hb=ce53d0d1ff76cc45f1f66504976a0549999677c0;hpb=1d9b1f888c9dcb7c82ce35682b4e9f0210f93f0a diff --git a/src/LWN/Page.hs b/src/LWN/Page.hs index d4aeb30..ccc2590 100644 --- a/src/LWN/Page.hs +++ b/src/LWN/Page.hs @@ -58,6 +58,7 @@ import LWN.XHTML ( is_image, preprocess, remove_byline, + remove_full_story_paragraphs, remove_title, to_xhtml, to_xml, @@ -134,7 +135,7 @@ insert_full_stories story_map = article_xml :: (ArrowXml a) => a XmlTree XmlTree article_xml = lookup_func - $< + $< -- From HXT's Control.Arrow.ArrowList (this /> full_story_link >>> getAttrValue "href") replace_remote_img_srcs :: (ArrowXml a) => ImageMap -> a XmlTree XmlTree @@ -192,11 +193,12 @@ download_full_stories cfg xml = do parse :: Cfg -> IOSArrow XmlTree XmlTree -> IO (Maybe Page) parse cfg xml = do - story_map <- download_full_stories cfg xml - let fs_xml = if (full_stories cfg) then - xml >>> insert_full_stories story_map - else - xml + fs_xml <- if (full_stories cfg) then do + story_map <- download_full_stories cfg xml + return $ xml >>> insert_full_stories story_map + else do + -- Get rid of them if we don't want them. + return $ xml >>> remove_full_story_paragraphs let clean_xml = fs_xml >>> preprocess image_map <- download_images clean_xml