diff options
author | Simon Hengel <sol@typeful.net> | 2012-04-04 16:32:11 +0200 |
---|---|---|
committer | Simon Hengel <sol@typeful.net> | 2012-05-27 08:48:24 +0200 |
commit | b19a4bea999c684e092e0ea0feaf02ff8747d2a5 (patch) | |
tree | 9a40b7eba5a0cd6644953b3ddeae335cef728fd2 /src/Haddock/Backends/LaTeX.hs | |
parent | 2a931d32cfdbd20d4da0cff6415a3aaf47823938 (diff) |
Add an optional label to URLs
Diffstat (limited to 'src/Haddock/Backends/LaTeX.hs')
-rw-r--r-- | src/Haddock/Backends/LaTeX.hs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/Haddock/Backends/LaTeX.hs b/src/Haddock/Backends/LaTeX.hs index 31ba3b0b..ef72505c 100644 --- a/src/Haddock/Backends/LaTeX.hs +++ b/src/Haddock/Backends/LaTeX.hs @@ -1011,7 +1011,7 @@ parLatexMarkup ppId = Markup { markupOrderedList = \p v -> enumeratedList (map ($v) p) $$ text "", markupDefList = \l v -> descriptionList (map (\(a,b) -> (a v, b v)) l), markupCodeBlock = \p _ -> quote (verb (p Verb)) $$ text "", - markupURL = \u _ -> text "\\url" <> braces (text u), + markupHyperlink = \l _ -> markupLink l, markupAName = \_ _ -> empty, markupExample = \e _ -> quote $ verb $ text $ unlines $ map exampleToString e } @@ -1020,6 +1020,10 @@ parLatexMarkup ppId = Markup { fixString Verb s = s fixString Mono s = latexMonoFilter s + markupLink (Hyperlink url mLabel) = case mLabel of + Just label -> text "\\href" <> braces (text url) <> braces (text label) + Nothing -> text "\\url" <> braces (text url) + markupId ppId_ id v = case v of Verb -> theid |