aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2018-02-16 10:41:22 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2018-02-16 10:41:22 -0800
commitded2e211ca181603ab1a0da3f938508efdb7cdf0 (patch)
treea5060d300fb1407bf9daf5459c0430aeaf29280f /src
parent0e4b8ae36296030569627baa537b9d71af621d20 (diff)
downloadpandoc-ded2e211ca181603ab1a0da3f938508efdb7cdf0.tar.gz
TEI writer: Use 'xml:id', not 'id' attribute.
Closes #4371.
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Writers/TEI.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Text/Pandoc/Writers/TEI.hs b/src/Text/Pandoc/Writers/TEI.hs
index be1c594aa..d49a58818 100644
--- a/src/Text/Pandoc/Writers/TEI.hs
+++ b/src/Text/Pandoc/Writers/TEI.hs
@@ -104,7 +104,7 @@ elementToTEI opts lvl (Sec _ _num (id',_,_) title elements) = do
contents <- vcat <$> mapM (elementToTEI opts (lvl + 1)) elements'
titleContents <- inlinesToTEI opts title
return $ inTags True "div" (("type", divType) :
- [("id", writerIdentifierPrefix opts ++ id') | not (null id')]) $
+ [("xml:id", writerIdentifierPrefix opts ++ id') | not (null id')]) $
inTagsSimple "head" titleContents $$ contents
-- | Convert a list of Pandoc blocks to TEI.
@@ -156,7 +156,7 @@ blockToTEI _ Null = return empty
-- Add ids to paragraphs in divs with ids - this is needed for
-- pandoc-citeproc to get link anchors in bibliographies:
blockToTEI opts (Div (ident,_,_) [Para lst]) = do
- let attribs = [("id", ident) | not (null ident)]
+ let attribs = [("xml:id", ident) | not (null ident)]
inTags False "p" attribs <$> inlinesToTEI opts lst
blockToTEI opts (Div _ bs) = blocksToTEI opts $ map plainToPara bs
blockToTEI _ h@Header{} = do
@@ -342,7 +342,7 @@ idAndRole (id',cls,_) = ident ++ role
where
ident = if null id'
then []
- else [("id", id')]
+ else [("xml:id", id')]
role = if null cls
then []
else [("role", unwords cls)]