diff options
| author | Robert Norton | 2018-11-14 15:33:10 +0000 |
|---|---|---|
| committer | Robert Norton | 2018-11-14 15:33:10 +0000 |
| commit | 5f00f0d75cfaabb89f2ec22115392443539664bd (patch) | |
| tree | fb9494361df8db6f585d53e5e2884c14e1df7781 /src | |
| parent | 0ea65cc4199e4a1924da93139c4790d9b85bb745 (diff) | |
Use code style For [id] refs in doc comments.
Diffstat (limited to 'src')
| -rw-r--r-- | src/latex.ml | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/latex.ml b/src/latex.ml index e0dba234..a86731b6 100644 --- a/src/latex.ml +++ b/src/latex.ml @@ -218,9 +218,11 @@ let latex_of_markdown str = | None -> failwith "Cannot create link to THIS" end | Ref (r, name, alt, _) -> + (* special case for [id] (format as code) *) + let format_fn = if name = alt then inline_code else replace_this in begin match r#get_ref name with - | None -> sprintf "\\hyperref[%s]{%s}" (refcode_string name) (replace_this alt) - | Some (link, _) -> sprintf "\\hyperref[%s]{%s}" (refcode_string link) (replace_this alt) + | None -> sprintf "\\hyperref[%s]{%s}" (refcode_string name) (format_fn alt) + | Some (link, _) -> sprintf "\\hyperref[%s]{%s}" (refcode_string link) (format_fn alt) end | Url (href, text, "") -> sprintf "\\href{%s}{%s}" href (format text) |
