Org writer: don't wrap link descriptions.

Org doesn't reliable display these as links if they have hard breaks.

Closes #9000.
This commit is contained in:
John MacFarlane
2025-07-27 11:17:06 -07:00
parent 8735bc03d8
commit bfbf67ca5d
3 changed files with 17 additions and 3 deletions
+1 -1
View File
@@ -547,7 +547,7 @@ inlineToOrg (Link _ txt (src, _)) =
case txt of
[Str x] | escapeURI x == src -> -- autolink
return $ "[[" <> literal (orgPath x) <> "]]"
_ -> do contents <- inlineListToOrg txt
_ -> do contents <- nowrap <$> inlineListToOrg txt
return $ "[[" <> literal (orgPath src) <> "][" <> contents <> "]]"
inlineToOrg (Image _ _ (source, _)) =
return $ "[[" <> literal (orgPath source) <> "]]"
+14
View File
@@ -0,0 +1,14 @@
```
% pandoc -t org --wrap=auto --columns=20
[This is a link with a long description that should not
wrap](http://example.com) and
some regular text after it so we can see how wrapping works.
^D
[[http://example.com][This is a link with a long description that should not wrap]]
and some regular
text after it so we
can see how wrapping
works.
```
+2 -2
View File
@@ -571,8 +571,8 @@ a^b c^d, a~b c~d.
'He said, "I want to go."' Were you alive in the 70's?
Here is some quoted '=code=' and a "[[http://example.com/?foo=1&bar=2][quoted
link]]".
Here is some quoted '=code=' and a
"[[http://example.com/?foo=1&bar=2][quoted link]]".
Some dashes: one---two --- three---four --- five.