getChildren,
getText,
hasName,
+ none,
processAttrl,
processTopDown,
this,
is_image,
preprocess,
remove_byline,
+ remove_full_story_paragraphs,
remove_title,
to_xhtml,
to_xml,
lookup_func :: (ArrowXml a) => URL -> a XmlTree XmlTree
lookup_func href =
case Map.lookup href story_map of
- -- Leave it alone if we don't have the full story.
- Nothing -> this
+ -- Drop the paragraph if we don't have the contents.
+ Nothing -> none
Just v -> to_xml v
article_xml :: (ArrowXml a) => a XmlTree XmlTree
story_map <- download_full_stories cfg xml
return $ xml >>> insert_full_stories story_map
else do
- return xml
+ -- 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