summaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Compat/TagSoupEntity.hs
blob: 80985aef9a5768ddecc88f7cce97657893cd19e9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
{-# LANGUAGE CPP #-}
module Text.Pandoc.Compat.TagSoupEntity (lookupEntity
                          ) where

import qualified Text.HTML.TagSoup.Entity as TE

lookupEntity :: String -> Maybe Char
#if MIN_VERSION_tagsoup(0,13,0)
lookupEntity = str2chr . TE.lookupEntity
  where str2chr :: Maybe String -> Maybe Char
        str2chr (Just [c]) = Just c
        str2chr _ = Nothing
#else
lookupEntity = TE.lookupEntity
#endif