aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <fiddlosopher@gmail.com>2011-11-29 13:31:12 -0800
committerJohn MacFarlane <fiddlosopher@gmail.com>2011-11-29 13:31:39 -0800
commit6eb6a9901333b5a9018c576ba425c6740a1309d2 (patch)
treeaa0a14529a8b39868755c0fb4bc40d15b2b7e3a4
parent05a26aef3aaf08e60c81a097be7447c98ee69a95 (diff)
downloadpandoc-6eb6a9901333b5a9018c576ba425c6740a1309d2.tar.gz
Use separate variables for meta-date, meta-author.
This makes footnotes work in author and date fields. Closes #301.
-rw-r--r--src/Text/Pandoc/Writers/HTML.hs15
m---------templates12
2 files changed, 13 insertions, 14 deletions
diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs
index ab164619d..e1e413641 100644
--- a/src/Text/Pandoc/Writers/HTML.hs
+++ b/src/Text/Pandoc/Writers/HTML.hs
@@ -160,16 +160,16 @@ inTemplate :: TemplateTarget a
-> [(String,String)]
-> a
inTemplate opts tit auths date toc body' newvars =
- let renderedTit = showHtmlFragment tit
- topTitle' = stripTags renderedTit
- authors = map (stripTags . showHtmlFragment) auths
- date' = stripTags $ showHtmlFragment date
+ let title' = dropWhile (=='\n') $ showHtmlFragment tit
+ authors = map showHtmlFragment auths
+ date' = showHtmlFragment date
variables = writerVariables opts ++ newvars
context = variables ++
[ ("body", dropWhile (=='\n') $ showHtmlFragment body')
- , ("pagetitle", topTitle')
- , ("title", dropWhile (=='\n') $ showHtmlFragment tit)
+ , ("pagetitle", stripTags title')
+ , ("title", title')
, ("date", date')
+ , ("date-meta", stripTags date')
, ("idprefix", writerIdentifierPrefix opts)
, ("slidy-url", "http://www.w3.org/Talks/Tools/Slidy2")
, ("s5-url", "s5/default") ] ++
@@ -177,7 +177,8 @@ inTemplate opts tit auths date toc body' newvars =
(case toc of
Just t -> [ ("toc", showHtmlFragment t)]
Nothing -> []) ++
- [ ("author", a) | a <- authors ]
+ [ ("author", a) | a <- authors ] ++
+ [ ("author-meta", stripTags a) | a <- authors ]
in renderTemplate context $ writerTemplate opts
-- | Like Text.XHtml's identifier, but adds the writerIdentifierPrefix
diff --git a/templates b/templates
-Subproject 6c48030dcd70359e5f9c2eeef8cb01873ac033a
+Subproject 5facbc552da097dd150112457866a7785cfb21d