diff options
| author | Pavel Kulyov <kulyov.pavel@gmail.com> | 2020-06-05 20:58:25 +0300 |
|---|---|---|
| committer | Stig Brautaset <stig@brautaset.org> | 2020-06-10 15:34:16 +0100 |
| commit | 8aa543b1911efd181c8ef5a33f98e4e01020eac1 (patch) | |
| tree | 5fe54200964759d29cd4d51fb192be594e2ac1aa | |
| parent | 00767df8ba024eb1ef09fe16c3aed30d729d6add (diff) | |
link: handle custom-id and headling links
Signed-off-by: Pavel Kulyov <kulyov.pavel@gmail.com>
| -rw-r--r-- | ox-jira.el | 4 | ||||
| -rw-r--r-- | ox-jira.org | 4 | ||||
| -rw-r--r-- | test/ox-jira-test.el | 10 |
3 files changed, 17 insertions, 1 deletions
@@ -284,6 +284,10 @@ INFO is a plist holding contextual information. See (concat type ":" raw-path)) ((string= type "file") (org-export-file-uri raw-path)) + ((string= type "custom-id") + (if desc (concat "#" desc) (concat "#" raw-path))) + ((string-prefix-p "*" raw-path) + (concat "#" (seq-subseq raw-path 1))) (t raw-path)))) (cond ;; Link with description diff --git a/ox-jira.org b/ox-jira.org index 8196fe5..8004485 100644 --- a/ox-jira.org +++ b/ox-jira.org @@ -492,6 +492,10 @@ but we must make a token effort. A lot of this code is cribbed from (concat type ":" raw-path)) ((string= type "file") (org-export-file-uri raw-path)) + ((string= type "custom-id") + (if desc (concat "#" desc) (concat "#" raw-path))) + ((string-prefix-p "*" raw-path) + (concat "#" (seq-subseq raw-path 1))) (t raw-path)))) (cond ;; Link with description diff --git a/test/ox-jira-test.el b/test/ox-jira-test.el index 688ed4a..293095d 100644 --- a/test/ox-jira-test.el +++ b/test/ox-jira-test.el @@ -123,7 +123,15 @@ h1. {color:red}{{TODO}}{color} This is another headline {color:blue}{{:FOO:BAR:} (should (equal "fi [http://jira.atlassian.com] fo\n" (to-jira "fi [[http://jira.atlassian.com]] fo"))) (should (equal "fi [Jira|http://jira.atlassian.com] fo\n" - (to-jira "fi [[http://jira.atlassian.com][Jira]] fo")))) + (to-jira "fi [[http://jira.atlassian.com][Jira]] fo"))) + (should (equal "see [#Heading Name] for details\n" + (to-jira "see [[*Heading Name]] for details"))) + (should (equal "see [This Thing|#Heading Name] for details\n" + (to-jira "see [[*Heading Name][This Thing]] for details"))) + (should (equal "see [#Heading Name] for details\n" + (to-jira "see [[#Heading Name]] for details"))) + (should (equal "see [This Thing|#This Thing] for details\n" + (to-jira "see [[#Heading Name][This Thing]] for details")))) ;; Check that text in paragraphs does not have hard newlines. ;; |
