aboutsummaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2010-07-04 23:26:04 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2010-07-05 00:06:28 -0700
commit306c4745621a4748fba70c8b029c0cf9d4d7a017 (patch)
tree64b62d8457ede8f092aff2bc0b1af4e2bc5a683a /src/Text
parent162b869aacb1c1334fdf8921b7bb77d17dea3bea (diff)
downloadpandoc-306c4745621a4748fba70c8b029c0cf9d4d7a017.tar.gz
Don't allow colon in autogenerated HTML identifiers.
They have a special meaning in XML (e.g. in EPUB).
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Shared.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Shared.hs b/src/Text/Pandoc/Shared.hs
index da6c1a3af..94be91b2d 100644
--- a/src/Text/Pandoc/Shared.hs
+++ b/src/Text/Pandoc/Shared.hs
@@ -364,11 +364,11 @@ data Element = Blk Block
-- | Convert Pandoc inline list to plain text identifier. HTML
-- identifiers must start with a letter, and may contain only
--- letters, digits, and the characters _-:.
+-- letters, digits, and the characters _-.
inlineListToIdentifier :: [Inline] -> String
inlineListToIdentifier =
dropWhile (not . isAlpha) . intercalate "-" . words . map toLower .
- filter (\c -> isLetter c || isDigit c || c `elem` "_-:. ") .
+ filter (\c -> isLetter c || isDigit c || c `elem` "_-. ") .
concatMap extractText
where extractText x = case x of
Str s -> s