Fix: (link) Allow brackets in description
Org 9.3 stopped replacing brackets in link descriptions with braces and started escaping them instead. Fixes #283. Thanks to Daniel Borchmann (@exot) for reporting.
This commit is contained in:
parent
3c73888b98
commit
9e14f9eefa
5 changed files with 115 additions and 68 deletions
10
tests/data-links.org
Normal file
10
tests/data-links.org
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
* Alpha
|
||||
|
||||
Let us link to: [[id:74d357ac-fb9c-40d1-a63f-eca8a227321d][Bravo [a phrase in brackets]]].
|
||||
|
||||
* Bravo [a phrase in brackets]
|
||||
:PROPERTIES:
|
||||
:ID: 74d357ac-fb9c-40d1-a63f-eca8a227321d
|
||||
:END:
|
||||
|
||||
* Charlie
|
||||
|
|
@ -1141,7 +1141,39 @@ with keyword arg NOW in PLIST."
|
|||
'("/r/emacs")))
|
||||
(org-ql-it "with :description and :target regexp"
|
||||
(org-ql-expect ('(link :description "em.cs" :target "em.cs" :regexp-p t))
|
||||
'("/r/emacs"))))
|
||||
'("/r/emacs")))
|
||||
|
||||
(describe "matches links whose descriptions contain brackets"
|
||||
(before-each
|
||||
(setq org-ql-test-buffer (org-ql-test-data-buffer "data-links.org")))
|
||||
|
||||
(org-ql-it "without arguments"
|
||||
(org-ql-expect ('(link))
|
||||
'("Alpha")))
|
||||
(org-ql-it "with description-or-target"
|
||||
(org-ql-expect ('(link "phrase"))
|
||||
'("Alpha")))
|
||||
(org-ql-it "with :description"
|
||||
(org-ql-expect ('(link :description "phrase"))
|
||||
'("Alpha")))
|
||||
(org-ql-it "with :target"
|
||||
(org-ql-expect ('(link :target "id:"))
|
||||
'("Alpha")))
|
||||
(org-ql-it "with :description and :target"
|
||||
(org-ql-expect ('(link :description "phrase" :target "id"))
|
||||
'("Alpha")))
|
||||
(org-ql-it "with description-or-target regexp"
|
||||
(org-ql-expect ('(link "id:.*" :regexp-p t))
|
||||
'("Alpha")))
|
||||
(org-ql-it "with :description regexp"
|
||||
(org-ql-expect ('(link :description "phr.se" :regexp-p t))
|
||||
'("Alpha")))
|
||||
(org-ql-it "with :target regexp"
|
||||
(org-ql-expect ('(link :target "id:.*" :regexp-p t))
|
||||
'("Alpha")))
|
||||
(org-ql-it "with :description and :target regexp"
|
||||
(org-ql-expect ('(link :description "phr.se" :target "id:.*" :regexp-p t))
|
||||
'("Alpha")))))
|
||||
|
||||
(describe "(outline-path)"
|
||||
(org-ql-it "with one argument"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue