Allow angular links within link descriptions
* lisp/org-element.el (org-element-object-restrictions): (org-element--object-lex): Allow angular links as equivalent to plain links in description. * testing/lisp/test-org-element.el (test-org-element/link-parser): Add test.
This commit is contained in:
parent
64ca6f2c24
commit
716e339c96
|
@ -286,6 +286,12 @@ plain list.
|
||||||
*** ~fixltx2e~ is removed from ~org-latex-default-packages-alist~
|
*** ~fixltx2e~ is removed from ~org-latex-default-packages-alist~
|
||||||
fixltx2e is obsolete, see LaTeX News 22.
|
fixltx2e is obsolete, see LaTeX News 22.
|
||||||
** Miscellaneous
|
** Miscellaneous
|
||||||
|
*** Allow angular links within link descriptions
|
||||||
|
It is now allowed to write, e.g.,
|
||||||
|
~[[http:orgmode.org][<file:unicorn.png>]]~ as an equivalent to
|
||||||
|
~[[http:orgmode.org][file:unicorn.png]]~. The advantage of the former
|
||||||
|
is that spaces are allowed within the path.
|
||||||
|
|
||||||
*** Beamer export back-ends uses ~org-latex-prefer-user-labels~
|
*** Beamer export back-ends uses ~org-latex-prefer-user-labels~
|
||||||
|
|
||||||
*** ~:preparation-function~ called earlier during publishing
|
*** ~:preparation-function~ called earlier during publishing
|
||||||
|
|
|
@ -352,10 +352,11 @@ Don't modify it, set `org-element-affiliated-keywords' instead.")
|
||||||
(italic ,@standard-set)
|
(italic ,@standard-set)
|
||||||
(item ,@standard-set-no-line-break)
|
(item ,@standard-set-no-line-break)
|
||||||
(keyword ,@(remq 'footnote-reference standard-set))
|
(keyword ,@(remq 'footnote-reference standard-set))
|
||||||
;; Ignore all links excepted plain links in a link description.
|
;; Ignore all links excepted plain links and angular links in
|
||||||
;; Also ignore radio-targets and line breaks.
|
;; a link description. Also ignore radio-targets and line
|
||||||
|
;; breaks.
|
||||||
(link bold code entity export-snippet inline-babel-call inline-src-block
|
(link bold code entity export-snippet inline-babel-call inline-src-block
|
||||||
italic latex-fragment macro plain-link statistics-cookie
|
italic latex-fragment macro simple-link statistics-cookie
|
||||||
strike-through subscript superscript underline verbatim)
|
strike-through subscript superscript underline verbatim)
|
||||||
(paragraph ,@standard-set)
|
(paragraph ,@standard-set)
|
||||||
;; Remove any variable object from radio target as it would
|
;; Remove any variable object from radio target as it would
|
||||||
|
@ -4336,7 +4337,8 @@ to an appropriate container (e.g., a paragraph)."
|
||||||
(org-element-target-parser)))
|
(org-element-target-parser)))
|
||||||
(or (and (memq 'timestamp restriction)
|
(or (and (memq 'timestamp restriction)
|
||||||
(org-element-timestamp-parser))
|
(org-element-timestamp-parser))
|
||||||
(and (memq 'link restriction)
|
(and (or (memq 'link restriction)
|
||||||
|
(memq 'simple-link restriction))
|
||||||
(org-element-link-parser)))))
|
(org-element-link-parser)))))
|
||||||
(?\\
|
(?\\
|
||||||
(if (eq (aref result 1) ?\\)
|
(if (eq (aref result 1) ?\\)
|
||||||
|
@ -4358,8 +4360,8 @@ to an appropriate container (e.g., a paragraph)."
|
||||||
(org-element-statistics-cookie-parser)))))
|
(org-element-statistics-cookie-parser)))))
|
||||||
;; This is probably a plain link.
|
;; This is probably a plain link.
|
||||||
(_ (and (or (memq 'link restriction)
|
(_ (and (or (memq 'link restriction)
|
||||||
(memq 'plain-link restriction))
|
(memq 'simple-link restriction))
|
||||||
(org-element-link-parser)))))))
|
(org-element-link-parser)))))))
|
||||||
(or (eobp) (forward-char))))
|
(or (eobp) (forward-char))))
|
||||||
(cond (found)
|
(cond (found)
|
||||||
;; Radio link.
|
;; Radio link.
|
||||||
|
|
|
@ -1688,8 +1688,8 @@ e^{i\\pi}+1=0
|
||||||
(org-element-type (org-element-context)))))
|
(org-element-type (org-element-context)))))
|
||||||
(should
|
(should
|
||||||
(equal "//orgmode.org"
|
(equal "//orgmode.org"
|
||||||
(org-test-with-temp-text "A link: <point><http://orgmode\n.org>"
|
(org-test-with-temp-text "A link: <point><http://orgmode\n.org>"
|
||||||
(org-element-property :path (org-element-context)))))
|
(org-element-property :path (org-element-context)))))
|
||||||
;; Link abbreviation.
|
;; Link abbreviation.
|
||||||
(should
|
(should
|
||||||
(equal "http"
|
(equal "http"
|
||||||
|
@ -1711,6 +1711,12 @@ e^{i\\pi}+1=0
|
||||||
(should
|
(should
|
||||||
(equal "file"
|
(equal "file"
|
||||||
(org-test-with-temp-text "[[http://orgmode.org][file:unicorn.jpg]]"
|
(org-test-with-temp-text "[[http://orgmode.org][file:unicorn.jpg]]"
|
||||||
|
(search-forward "file:")
|
||||||
|
(org-element-property :type (org-element-context)))))
|
||||||
|
;; So are angular links.
|
||||||
|
(should
|
||||||
|
(equal "file"
|
||||||
|
(org-test-with-temp-text "[[http://orgmode.org][<file:unicorn.jpg>]]"
|
||||||
(search-forward "file:")
|
(search-forward "file:")
|
||||||
(org-element-property :type (org-element-context))))))
|
(org-element-property :type (org-element-context))))))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue