aboutsummaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
authorJohn MacFarlane <fiddlosopher@gmail.com>2013-08-28 08:43:51 -0700
committerJohn MacFarlane <fiddlosopher@gmail.com>2013-08-28 08:43:51 -0700
commitdd5cb82348dfb2b8febb01db8bdc98ddeac394dc (patch)
treef12aa2bb7d2a0b3d5ebf655291cb6bc82d48207f /src/Text
parent80148095781b44c7f5af132b48605adaa93a0558 (diff)
downloadpandoc-dd5cb82348dfb2b8febb01db8bdc98ddeac394dc.tar.gz
Generalized type of stringify.
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Shared.hs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/Text/Pandoc/Shared.hs b/src/Text/Pandoc/Shared.hs
index eef150351..9a9a092fc 100644
--- a/src/Text/Pandoc/Shared.hs
+++ b/src/Text/Pandoc/Shared.hs
@@ -1,4 +1,5 @@
-{-# LANGUAGE DeriveDataTypeable, CPP, MultiParamTypeClasses #-}
+{-# LANGUAGE DeriveDataTypeable, CPP, MultiParamTypeClasses,
+ FlexibleContexts #-}
{-
Copyright (C) 2006-2013 John MacFarlane <jgm@berkeley.edu>
@@ -383,10 +384,10 @@ consolidateInlines (Code a1 x : Code a2 y : zs) | a1 == a2 =
consolidateInlines (x : xs) = x : consolidateInlines xs
consolidateInlines [] = []
--- | Convert list of inlines to a string with formatting removed.
+-- | Convert pandoc structure to a string with formatting removed.
-- Footnotes are skipped (since we don't want their contents in link
-- labels).
-stringify :: [Inline] -> String
+stringify :: Walkable Inline a => a -> String
stringify = query go . walk deNote
where go :: Inline -> [Char]
go Space = " "