aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavel Kulyov <kulyov.pavel@gmail.com>2020-06-05 20:58:25 +0300
committerStig Brautaset <stig@brautaset.org>2020-06-10 15:34:16 +0100
commit8aa543b1911efd181c8ef5a33f98e4e01020eac1 (patch)
tree5fe54200964759d29cd4d51fb192be594e2ac1aa
parent00767df8ba024eb1ef09fe16c3aed30d729d6add (diff)
link: handle custom-id and headling links
Signed-off-by: Pavel Kulyov <kulyov.pavel@gmail.com>
-rw-r--r--ox-jira.el4
-rw-r--r--ox-jira.org4
-rw-r--r--test/ox-jira-test.el10
3 files changed, 17 insertions, 1 deletions
diff --git a/ox-jira.el b/ox-jira.el
index 71ab613..f49c281 100644
--- a/ox-jira.el
+++ b/ox-jira.el
@@ -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.
;;