aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Text/Pandoc/Writers/LaTeX.hs16
-rw-r--r--test/command/1710.md5
-rw-r--r--test/command/4016.md5
3 files changed, 12 insertions, 14 deletions
diff --git a/src/Text/Pandoc/Writers/LaTeX.hs b/src/Text/Pandoc/Writers/LaTeX.hs
index f61c878e5..58a4c4d86 100644
--- a/src/Text/Pandoc/Writers/LaTeX.hs
+++ b/src/Text/Pandoc/Writers/LaTeX.hs
@@ -411,15 +411,15 @@ elementToBeamer slideLevel (Sec lvl _num (ident,classes,kvs) tit elts)
slideTitle <-
if tit == [Str "\0"] -- marker for hrule
then return []
- else
- if null ident
- then return $ latex "{" : tit ++ [latex "}"]
- else do
- ref <- toLabel ident
- return $ latex ("{%\n\\protect\\hypertarget{" ++
- ref ++ "}{%\n") : tit ++ [latex "}}"]
+ else return $ latex "{" : tit ++ [latex "}"]
+ ref <- toLabel ident
+ let slideAnchor = if null ident
+ then []
+ else [latex ("\n\\protect\\hypertarget{" ++
+ ref ++ "}{}")]
let slideStart = Para $
- RawInline "latex" ("\\begin{frame}" ++ options) : slideTitle
+ RawInline "latex" ("\\begin{frame}" ++ options) :
+ slideTitle ++ slideAnchor
let slideEnd = RawBlock "latex" "\\end{frame}"
-- now carve up slide into blocks if there are sections inside
bs <- concat `fmap` mapM (elementToBeamer slideLevel) elts
diff --git a/test/command/1710.md b/test/command/1710.md
index d14f1217f..d20dfe191 100644
--- a/test/command/1710.md
+++ b/test/command/1710.md
@@ -54,9 +54,8 @@ ok
</div>
</div>
^D
-\begin{frame}{%
-\protect\hypertarget{slide-one}{%
-Slide one}}
+\begin{frame}{Slide one}
+\protect\hypertarget{slide-one}{}
\begin{columns}[T]
\begin{column}{0.40\textwidth}
diff --git a/test/command/4016.md b/test/command/4016.md
index 69ad1c911..3918251c6 100644
--- a/test/command/4016.md
+++ b/test/command/4016.md
@@ -13,9 +13,8 @@ pandoc -t beamer
</div>
</div>
^D
-\begin{frame}{%
-\protect\hypertarget{level-2-blocks}{%
-Level 2 blocks}}
+\begin{frame}{Level 2 blocks}
+\protect\hypertarget{level-2-blocks}{}
\begin{columns}[T]
\begin{column}{0.40\textwidth}