aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Text/Pandoc/Readers/Markdown.hs10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs
index 84d93afdb..dcf7f1b1a 100644
--- a/src/Text/Pandoc/Readers/Markdown.hs
+++ b/src/Text/Pandoc/Readers/Markdown.hs
@@ -42,6 +42,7 @@ import Text.Pandoc.Builder (Inlines, Blocks, trimInlines, (<>))
import Text.Pandoc.Options
import Text.Pandoc.Shared
import Text.Pandoc.XML (fromEntities)
+import Text.Pandoc.Asciify (toAsciiChar)
import Text.Pandoc.Parsing hiding (tableWith)
import Text.Pandoc.Readers.LaTeX ( rawLaTeXInline, rawLaTeXBlock )
import Text.Pandoc.Readers.HTML ( htmlTag, htmlInBalanced, isInlineTag, isBlockTag,
@@ -397,10 +398,15 @@ addToHeaderList (ident,classes,kvs) text = do
then do
ids <- stateIdentifiers `fmap` getState
let id' = uniqueIdent (B.toList header') ids
+ let id'' = if Ext_ascii_identifiers `Set.member` exts
+ then catMaybes $ map toAsciiChar id'
+ else id'
updateState $ \st -> st{
- stateIdentifiers = id' : ids,
+ stateIdentifiers = if id' == id''
+ then id' : ids
+ else id' : id'' : ids,
stateHeaders = insert' header' id' $ stateHeaders st }
- return (id',classes,kvs)
+ return (id'',classes,kvs)
else do
unless (null ident) $
updateState $ \st -> st{