git.iko.soy/typeable/pandoc
on master help sign in
Beamer: put hyperlink after `\begin{frame}`.

and not in the title. If it's in the title, then we get a titlebar on slides with the `plain` attribute, when the id is non-null. This fixes a regression from 1.9.x. Closes #4307.

commit17725a0661dabd8d8b9203adbe08fe9e4c6780fe authorJohn MacFarlane <jgm@berkeley.edu> dateTue 13 Mar 2018, 10:02 (9 years ago) parentf921b38
3 files changed+12−14
src/Text/Pandoc/Writers/LaTeX.hs+8−8 test/command/1710.md+2−3 test/command/4016.md+2−3
src/Text/Pandoc/Writers/LaTeX.hs+8−8
@@ -411,15 +411,15 @@ elementToBeamer slideLevel (Sec lvl _num (ident,classes,kvs) tit elts)
411411 slideTitle <-
412412 if tit == [Str "\0"] -- marker for hrule
413413 then return []
414− else
415− if null ident
416− then return $ latex "{" : tit ++ [latex "}"]
417− else do
418− ref <- toLabel ident
419− return $ latex ("{%\n\\protect\\hypertarget{" ++
420− ref ++ "}{%\n") : tit ++ [latex "}}"]
414+ else return $ latex "{" : tit ++ [latex "}"]
415+ ref <- toLabel ident
416+ let slideAnchor = if null ident
417+ then []
418+ else [latex ("\n\\protect\\hypertarget{" ++
419+ ref ++ "}{}")]
421420 let slideStart = Para $
422− RawInline "latex" ("\\begin{frame}" ++ options) : slideTitle
421+ RawInline "latex" ("\\begin{frame}" ++ options) :
422+ slideTitle ++ slideAnchor
423423 let slideEnd = RawBlock "latex" "\\end{frame}"
424424 -- now carve up slide into blocks if there are sections inside
425425 bs <- concat `fmap` mapM (elementToBeamer slideLevel) elts
test/command/1710.md+2−3
@@ -54,9 +54,8 @@ ok
5454</div>
5555</div>
5656^D
57−\begin{frame}{%
58−\protect\hypertarget{slide-one}{%
59−Slide one}}
57+\begin{frame}{Slide one}
58+\protect\hypertarget{slide-one}{}
6059
6160\begin{columns}[T]
6261\begin{column}{0.40\textwidth}
test/command/4016.md+2−3
@@ -13,9 +13,8 @@ pandoc -t beamer
1313</div>
1414</div>
1515^D
16−\begin{frame}{%
17−\protect\hypertarget{level-2-blocks}{%
18−Level 2 blocks}}
16+\begin{frame}{Level 2 blocks}
17+\protect\hypertarget{level-2-blocks}{}
1918
2019\begin{columns}[T]
2120\begin{column}{0.40\textwidth}