git.iko.soy/typeable/pandoc
on master help sign in
Markdown reader: Implemented `Ext_ascii_identifiers`.
031686bJohn MacFarlane
src/Text/Pandoc/Readers/Markdown.hs+8−2
@@ -42,6 +42,7 @@ import Text.Pandoc.Builder (Inlines, Blocks, trimInlines, (<>))
42import Text.Pandoc.Options
42import Text.Pandoc.Options
43import Text.Pandoc.Shared
43import Text.Pandoc.Shared
44import Text.Pandoc.XML (fromEntities)
44import Text.Pandoc.XML (fromEntities)
45+import Text.Pandoc.Asciify (toAsciiChar)
45import Text.Pandoc.Parsing hiding (tableWith)
46import Text.Pandoc.Parsing hiding (tableWith)
46import Text.Pandoc.Readers.LaTeX ( rawLaTeXInline, rawLaTeXBlock )
47import Text.Pandoc.Readers.LaTeX ( rawLaTeXInline, rawLaTeXBlock )
47import Text.Pandoc.Readers.HTML ( htmlTag, htmlInBalanced, isInlineTag, isBlockTag,
48import Text.Pandoc.Readers.HTML ( htmlTag, htmlInBalanced, isInlineTag, isBlockTag,
@@ -397,10 +398,15 @@ addToHeaderList (ident,classes,kvs) text = do
397 then do
398 then do
398 ids <- stateIdentifiers `fmap` getState
399 ids <- stateIdentifiers `fmap` getState
399 let id' = uniqueIdent (B.toList header') ids
400 let id' = uniqueIdent (B.toList header') ids
401+ let id'' = if Ext_ascii_identifiers `Set.member` exts
402+ then catMaybes $ map toAsciiChar id'
403+ else id'
400 updateState $ \st -> st{
404 updateState $ \st -> st{
401− stateIdentifiers = id' : ids,
405+ stateIdentifiers = if id' == id''
406+ then id' : ids
407+ else id' : id'' : ids,
402 stateHeaders = insert' header' id' $ stateHeaders st }
408 stateHeaders = insert' header' id' $ stateHeaders st }
403− return (id',classes,kvs)
409+ return (id'',classes,kvs)
404 else do
410 else do
405 unless (null ident) $
411 unless (null ident) $
406 updateState $ \st -> st{
412 updateState $ \st -> st{