Markdown writer: Use autolink when link text matches url.
Previously we also checked for a null title, but this test fails for links produced by citeproc-hs in bibliographies. So, if the link has a title, it will be lost on conversion to an autolink, but that seems okay.
This commit is contained in:
parent
412863df7f
commit
2f50406c7f
1 changed files with 3 additions and 3 deletions
|
@ -644,9 +644,9 @@ inlineToMarkdown opts (Link txt (src, tit)) = do
|
|||
then empty
|
||||
else text $ " \"" ++ tit ++ "\""
|
||||
let srcSuffix = if isPrefixOf "mailto:" src then drop 7 src else src
|
||||
let useAuto = case (tit,txt) of
|
||||
("", [Str s]) | escapeURI s == srcSuffix -> True
|
||||
_ -> False
|
||||
let useAuto = case txt of
|
||||
[Str s] | escapeURI s == srcSuffix -> True
|
||||
_ -> False
|
||||
let useRefLinks = writerReferenceLinks opts && not useAuto
|
||||
ref <- if useRefLinks then getReference txt (src, tit) else return []
|
||||
reftext <- inlineListToMarkdown opts ref
|
||||
|
|
Loading…
Reference in a new issue