LaTeX writer: add \protect
to \hyperlink
.
Thanks to Hadrien Mary for the problem and solution. Closes #2490.
This commit is contained in:
parent
3b4d5d26a5
commit
1d53d452c3
2 changed files with 2 additions and 2 deletions
|
@ -881,7 +881,7 @@ inlineToLaTeX Space = return space
|
|||
inlineToLaTeX (Link txt ('#':ident, _)) = do
|
||||
contents <- inlineListToLaTeX txt
|
||||
lab <- toLabel ident
|
||||
return $ text "\\hyperlink" <> braces (text lab) <> braces contents
|
||||
return $ text "\\protect\\hyperlink" <> braces (text lab) <> braces contents
|
||||
inlineToLaTeX (Link txt (src, _)) =
|
||||
case txt of
|
||||
[Str x] | escapeURI x == src -> -- autolink
|
||||
|
|
|
@ -42,7 +42,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[\\hyperlink{go}{testing}]\nhi there\n\\end{description}"
|
||||
"\\begin{description}\n\\tightlist\n\\item[\\protect\\hyperlink{go}{testing}]\nhi there\n\\end{description}"
|
||||
]
|
||||
, testGroup "math"
|
||||
[ "escape |" =: para (math "\\sigma|_{\\{x\\}}") =?>
|
||||
|
|
Loading…
Reference in a new issue