git.iko.soy/typeable/pandoc
on master help sign in
Use separate variables for meta-date, meta-author.

This makes footnotes work in author and date fields. Closes #301.

commit6eb6a9901333b5a9018c576ba425c6740a1309d2 authorJohn MacFarlane <fiddlosopher@gmail.com> dateTue 29 Nov 2011, 13:31 (15 years ago) parent05a26ae
2 files changed+9−8
src/Text/Pandoc/Writers/HTML.hs+8−7 templates+1−1
src/Text/Pandoc/Writers/HTML.hs+8−7
@@ -160,16 +160,16 @@ inTemplate :: TemplateTarget a
160160 -> [(String,String)]
161161 -> a
162162inTemplate opts tit auths date toc body' newvars =
163− let renderedTit = showHtmlFragment tit
164− topTitle' = stripTags renderedTit
165− authors = map (stripTags . showHtmlFragment) auths
166− date' = stripTags $ showHtmlFragment date
163+ let title' = dropWhile (=='\n') $ showHtmlFragment tit
164+ authors = map showHtmlFragment auths
165+ date' = showHtmlFragment date
167166 variables = writerVariables opts ++ newvars
168167 context = variables ++
169168 [ ("body", dropWhile (=='\n') $ showHtmlFragment body')
170− , ("pagetitle", topTitle')
171− , ("title", dropWhile (=='\n') $ showHtmlFragment tit)
169+ , ("pagetitle", stripTags title')
170+ , ("title", title')
172171 , ("date", date')
172+ , ("date-meta", stripTags date')
173173 , ("idprefix", writerIdentifierPrefix opts)
174174 , ("slidy-url", "http://www.w3.org/Talks/Tools/Slidy2")
175175 , ("s5-url", "s5/default") ] ++
@@ -177,7 +177,8 @@ inTemplate opts tit auths date toc body' newvars =
177177 (case toc of
178178 Just t -> [ ("toc", showHtmlFragment t)]
179179 Nothing -> []) ++
180− [ ("author", a) | a <- authors ]
180+ [ ("author", a) | a <- authors ] ++
181+ [ ("author-meta", stripTags a) | a <- authors ]
181182 in renderTemplate context $ writerTemplate opts
182183
183184-- | Like Text.XHtml's identifier, but adds the writerIdentifierPrefix
templates+1−1

Submodule changed.