mirror of
https://github.com/jgm/pandoc.git
synced 2026-08-28 17:20:47 +08:00
Fix regression with ascii_identifiers and Turkish undotted i.
Closes #8003.
This commit is contained in:
@@ -18,11 +18,15 @@ import Data.Text (Text)
|
||||
import qualified Data.Text as T
|
||||
|
||||
toAsciiText :: Text -> Text
|
||||
toAsciiText = T.filter isAscii . TN.normalize (TN.NFD)
|
||||
toAsciiText = T.filter isAscii . T.map specialCase . TN.normalize (TN.NFD)
|
||||
where
|
||||
specialCase '\x131' = 'i' -- Turkish undotted i
|
||||
specialCase c = c
|
||||
|
||||
toAsciiChar :: Char -> Maybe Char
|
||||
toAsciiChar c = case T.unpack (TN.normalize TN.NFD (T.singleton c)) of
|
||||
(x:xs) | isAscii x
|
||||
, all isMark xs
|
||||
-> Just x
|
||||
['\x131'] -> Just 'i' -- Turkish undotted i
|
||||
_ -> Nothing
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
```
|
||||
% pandoc -f markdown+ascii_identifiers
|
||||
# Işık
|
||||
^D
|
||||
<h1 id="isik">Işık</h1>
|
||||
```
|
||||
Reference in New Issue
Block a user