mirror of
https://github.com/jgm/pandoc.git
synced 2026-09-01 13:15:51 +00:00
git-svn-id: https://pandoc.googlecode.com/svn/trunk@1526 788f1e2b-df1e-0410-8736-df70ead52e1b
16 lines
432 B
Haskell
16 lines
432 B
Haskell
module ListLinksPlugin (transform) where
|
|
import Text.Pandoc
|
|
|
|
-- This plugin returns an empty document and prints a list
|
|
-- of the URLs linked to in the source document.
|
|
|
|
transform :: Pandoc -> IO Pandoc
|
|
transform p = do
|
|
let urls = queryWith findURLs p
|
|
putStrLn $ unlines urls
|
|
return $ Pandoc (Meta [] [] []) []
|
|
|
|
findURLs :: Inline -> [String]
|
|
findURLs (Link label (url, title)) = [url]
|
|
findURLs x = []
|