mirror of
https://github.com/jgm/pandoc.git
synced 2026-08-25 01:36:45 +00:00
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:
@@ -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) <> "]]"
|
||||
|
||||
@@ -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
@@ -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.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user