X-Git-Url: http://gitweb.michael.orlitzky.com/?p=dead%2Flwn-epub.git;a=blobdiff_plain;f=src%2FLWN%2FXHTML.hs;h=c54bada32538c97e5e0f6d9c5fe579a37e2a4f77;hp=a2f103fa0d83b7ae433f239036e02456eb6e08f3;hb=ce53d0d1ff76cc45f1f66504976a0549999677c0;hpb=fc0052e451aa03675ebd9a128dfa46573b9357d7 diff --git a/src/LWN/XHTML.hs b/src/LWN/XHTML.hs index a2f103f..c54bada 100644 --- a/src/LWN/XHTML.hs +++ b/src/LWN/XHTML.hs @@ -9,6 +9,7 @@ module LWN.XHTML ( parse_lwn, preprocess, remove_byline, + remove_full_story_paragraphs, remove_title, to_xhtml, to_xml, @@ -16,7 +17,6 @@ module LWN.XHTML ( where import Text.HandsomeSoup (css) -import Text.Regex.Posix ((=~)) import Text.XML.HXT.Core ( (>>>), (/>), @@ -91,6 +91,11 @@ is_link = isElem >>> hasName "a" +remove_full_story_paragraphs :: (ArrowXml a) => a XmlTree XmlTree +remove_full_story_paragraphs = + processTopDown $ none `when` full_story_paragraph + + remove_comment_links :: (ArrowXml a) => a XmlTree XmlTree remove_comment_links = processTopDown $ kill_comments `when` is_link @@ -163,7 +168,7 @@ full_story_link = hasName "a" >>> ifA - (this /> hasText (=~ "Full Story")) + (this /> hasText (== "Full Story")) this none