diff options
author | John MacFarlane <jgm@berkeley.edu> | 2021-03-21 23:38:47 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2021-03-21 23:40:19 -0700 |
commit | 052056289fc6f884a2a8799dacca64a16248a5c2 (patch) | |
tree | f5fa7f841d9b52b6d14a3894b53006bf2a520fac /src/Text/Pandoc/Shared.hs | |
parent | 13021313e87a3074a113c1b81bcd8e5d28a279fb (diff) | |
download | pandoc-052056289fc6f884a2a8799dacca64a16248a5c2.tar.gz |
Simplify T.P.Asciify and export toAsciiText [API change].
Instead of encoding a giant (and incomplete) map, we now
just use unicode-transforms to normalize the text to
a canonical decomposition, and manipulate the result.
The new `toAsciiText` is equivalent to the old
`T.pack . mapMaybe toAsciiChar . T.unpack` but should be faster.
Diffstat (limited to 'src/Text/Pandoc/Shared.hs')
-rw-r--r-- | src/Text/Pandoc/Shared.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Shared.hs b/src/Text/Pandoc/Shared.hs index 23adff909..3292b32f4 100644 --- a/src/Text/Pandoc/Shared.hs +++ b/src/Text/Pandoc/Shared.hs @@ -123,7 +123,7 @@ import Text.HTML.TagSoup (RenderOptions (..), Tag (..), renderOptions, import Text.Pandoc.Builder (Blocks, Inlines, ToMetaValue (..)) import qualified Text.Pandoc.Builder as B import Data.Time -import Text.Pandoc.Asciify (toAsciiChar) +import Text.Pandoc.Asciify (toAsciiText) import Text.Pandoc.Definition import Text.Pandoc.Extensions (Extensions, Extension(..), extensionEnabled) import Text.Pandoc.Generic (bottomUp) @@ -478,7 +478,7 @@ inlineListToIdentifier exts = | otherwise = T.dropWhile (not . isAlpha) filterAscii | extensionEnabled Ext_ascii_identifiers exts - = T.pack . mapMaybe toAsciiChar . T.unpack + = toAsciiText | otherwise = id toIdent | extensionEnabled Ext_gfm_auto_identifiers exts = |