From a42703d3c025d4319ce9e16f21d482f9d9cf6e51 Mon Sep 17 00:00:00 2001 From: fiddlosopher Date: Tue, 1 Dec 2009 07:44:06 +0000 Subject: Allow . and ~ in header identifiers. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1638 788f1e2b-df1e-0410-8736-df70ead52e1b --- README | 3 ++- src/Text/Pandoc/Shared.hs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README b/README index ecf41cb3a..d91d1f702 100644 --- a/README +++ b/README @@ -870,7 +870,8 @@ identifier. This identifier is based on the text of the header. To derive the identifier from the header text, - Remove all formatting, links, etc. - - Remove all punctuation, except underscores and hyphens. + - Remove all punctuation, except underscores, hyphens, periods, + and tildes. - Replace all spaces and newlines with hyphens. - Convert all alphabetic characters to lowercase. - Remove everything up to the first letter (identifiers may diff --git a/src/Text/Pandoc/Shared.hs b/src/Text/Pandoc/Shared.hs index 73b5740d1..13f4ec3dc 100644 --- a/src/Text/Pandoc/Shared.hs +++ b/src/Text/Pandoc/Shared.hs @@ -893,7 +893,7 @@ inlineListToIdentifier' [] = "" inlineListToIdentifier' (x:xs) = xAsText ++ inlineListToIdentifier' xs where xAsText = case x of - Str s -> filter (\c -> c `elem` "_-" || not (isPunctuation c)) $ + Str s -> filter (\c -> c `elem` "_-.~" || not (isPunctuation c)) $ intercalate "-" $ words $ map toLower s Emph lst -> inlineListToIdentifier' lst Strikeout lst -> inlineListToIdentifier' lst -- cgit v1.2.3