From dd5cb82348dfb2b8febb01db8bdc98ddeac394dc Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 28 Aug 2013 08:43:51 -0700 Subject: Generalized type of stringify. --- src/Text/Pandoc/Shared.hs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/Text') 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 @@ -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 = " " -- cgit v1.2.3