diff options
| author | John MacFarlane <jgm@berkeley.edu> | 2023-08-19 09:52:01 -0700 |
|---|---|---|
| committer | John MacFarlane <jgm@berkeley.edu> | 2023-08-19 09:52:01 -0700 |
| commit | 70329edcd7afb7b3f8f015b13ab2e734c9e31d05 (patch) | |
| tree | 34c8363de72e10ae737681f4cdbdb3f25b5f4a97 /test/Tests | |
| parent | 068fce4293eb139f54d4825e1dbdcaf35e34da03 (diff) | |
LaTeX writer: improve internal links and targets.
We no longer wrap section headings in a `\hypertarget`.
This is unnecessary (hyperref creates an anchor based on the
label) and it interferes with tagging.
In addition, we now use `\hyperref` rather than `\hyperlink`
for internal links.
Currently `\hypertarget` is still being used for link anchors
not on headings.
Closes #8744. Thanks to @u-fischer.
Diffstat (limited to 'test/Tests')
| -rw-r--r-- | test/Tests/Writers/LaTeX.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/Tests/Writers/LaTeX.hs b/test/Tests/Writers/LaTeX.hs index 35693d478..d1cec5d2b 100644 --- a/test/Tests/Writers/LaTeX.hs +++ b/test/Tests/Writers/LaTeX.hs @@ -50,7 +50,7 @@ tests = [ testGroup "code blocks" , testGroup "definition lists" [ "with internal link" =: definitionList [(link "#go" "" (str "testing"), [plain (text "hi there")])] =?> - "\\begin{description}\n\\tightlist\n\\item[{\\protect\\hyperlink{go}{testing}}]\nhi there\n\\end{description}" + "\\begin{description}\n\\tightlist\n\\item[{\\hyperref[go]{testing}}]\nhi there\n\\end{description}" ] , testGroup "math" [ "escape |" =: para (math "\\sigma|_{\\{x\\}}") =?> @@ -60,7 +60,7 @@ tests = [ testGroup "code blocks" [ "unnumbered header" =: headerWith ("foo",["unnumbered"],[]) 1 (text "Header 1" <> note (plain $ text "note")) =?> - "\\hypertarget{foo}{%\n\\section*{\\texorpdfstring{Header 1\\footnote{note}}{Header 1}}\\label{foo}}\n\\addcontentsline{toc}{section}{Header 1}\n" + "\\section*{\\texorpdfstring{Header 1\\footnote{note}}{Header 1}}\\label{foo}\n\\addcontentsline{toc}{section}{Header 1}\n" , "in list item" =: bulletList [header 2 (text "foo")] =?> "\\begin{itemize}\n\\item ~\n \\subsection{foo}\n\\end{itemize}" |
