aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStig Brautaset <stig@brautaset.org>2016-02-28 09:16:00 +0000
committerStig Brautaset <stig@brautaset.org>2016-02-28 09:16:00 +0000
commitd28f752cfacf7bc22c34e17229f974537a67ec28 (patch)
treee1c3a81ac1f4fd03b23cce7c80599ddd5fbd4a8e
parent75b928135b7860c6558c15144524671558f2aed2 (diff)
Support sub- & superscript too, since it was very easy
-rw-r--r--ox-jira.el16
-rw-r--r--ox-jira.org24
-rw-r--r--test/ox-jira-test.el2
-rw-r--r--test/ox-jira-test.org2
4 files changed, 40 insertions, 4 deletions
diff --git a/ox-jira.el b/ox-jira.el
index 8afc6db..3e77038 100644
--- a/ox-jira.el
+++ b/ox-jira.el
@@ -79,8 +79,8 @@
(src-block . org-jira-src-block)
(statistics-cookie . org-jira-statistics-cookie)
(strike-through . org-jira-strike-through)
- (subscript . (lambda (&rest args) (org-jira--not-implemented 'subscript)))
- (superscript . (lambda (&rest args) (org-jira--not-implemented 'superscript)))
+ (subscript . org-jira-subscript)
+ (superscript . org-jira-superscript)
(table . org-jira-table)
(table-cell . org-jira-table-cell)
(table-row . org-jira-table-row)
@@ -232,6 +232,18 @@ contextual information."
lang
code))))
+(defun org-jira-subscript (subscript contents info)
+ "Transcode SUBSCRIPT from Org to JIRA.
+CONTENTS is the text with subscript markup. INFO is a plist holding
+contextual information."
+ (format "~%s~" contents))
+
+(defun org-jira-superscript (superscript contents info)
+ "Transcode SUPERSCRIPT from Org to JIRA.
+CONTENTS is the text with superscript markup. INFO is a plist holding
+contextual information."
+ (format "^%s^" contents))
+
(defun org-jira-table (table contents info)
"Transcode a TABLE element from Org to JIRA.
CONTENTS holds the contents of the table. INFO is a plist holding
diff --git a/ox-jira.org b/ox-jira.org
index ab3c156..e55e8f8 100644
--- a/ox-jira.org
+++ b/ox-jira.org
@@ -169,8 +169,8 @@
(src-block . org-jira-src-block)
(statistics-cookie . org-jira-statistics-cookie)
(strike-through . org-jira-strike-through)
- (subscript . (lambda (&rest args) (org-jira--not-implemented 'subscript)))
- (superscript . (lambda (&rest args) (org-jira--not-implemented 'superscript)))
+ (subscript . org-jira-subscript)
+ (superscript . org-jira-superscript)
(table . org-jira-table)
(table-cell . org-jira-table-cell)
(table-row . org-jira-table-row)
@@ -441,6 +441,26 @@
code))))
#+END_SRC
+*** Subscript
+
+ #+BEGIN_SRC emacs-lisp
+ (defun org-jira-subscript (subscript contents info)
+ "Transcode SUBSCRIPT from Org to JIRA.
+ CONTENTS is the text with subscript markup. INFO is a plist holding
+ contextual information."
+ (format "~%s~" contents))
+ #+END_SRC
+
+*** Superscript
+
+ #+BEGIN_SRC emacs-lisp
+ (defun org-jira-superscript (superscript contents info)
+ "Transcode SUPERSCRIPT from Org to JIRA.
+ CONTENTS is the text with superscript markup. INFO is a plist holding
+ contextual information."
+ (format "^%s^" contents))
+ #+END_SRC
+
*** Table
Org's table editor is one of the many reasons to use Org. It is excellent.
diff --git a/test/ox-jira-test.el b/test/ox-jira-test.el
index 5aab8da..4b7757e 100644
--- a/test/ox-jira-test.el
+++ b/test/ox-jira-test.el
@@ -33,6 +33,8 @@
(should (equal "this is *strong* text\n" (org-export-string-as "this is *strong* text" 'jira)))
(should (equal "this is _emphasised_ text\n" (org-export-string-as "this is /emphasised/ text" 'jira)))
(should (equal "this is +underlined+ text\n" (org-export-string-as "this is _underlined_ text" 'jira)))
+ (should (equal "this is super^scripted^ text\n" (org-export-string-as "this is super^scripted text" 'jira)))
+ (should (equal "this is sub~scripted~ text\n" (org-export-string-as "this is sub_scripted text" 'jira)))
(should (equal "this is -deleted- text\n" (org-export-string-as "this is +deleted+ text" 'jira)))
(should (equal "this is {{inline code}}\n" (org-export-string-as "this is ~inline code~" 'jira)))
(should (equal "this is {{verbatim}} text\n" (org-export-string-as "this is =verbatim= text" 'jira))))
diff --git a/test/ox-jira-test.org b/test/ox-jira-test.org
index 75272d7..9cb8a6b 100644
--- a/test/ox-jira-test.org
+++ b/test/ox-jira-test.org
@@ -91,6 +91,8 @@
(should (equal "this is *strong* text\n" (org-export-string-as "this is *strong* text" 'jira)))
(should (equal "this is _emphasised_ text\n" (org-export-string-as "this is /emphasised/ text" 'jira)))
(should (equal "this is +underlined+ text\n" (org-export-string-as "this is _underlined_ text" 'jira)))
+ (should (equal "this is super^scripted^ text\n" (org-export-string-as "this is super^scripted text" 'jira)))
+ (should (equal "this is sub~scripted~ text\n" (org-export-string-as "this is sub_scripted text" 'jira)))
(should (equal "this is -deleted- text\n" (org-export-string-as "this is +deleted+ text" 'jira)))
(should (equal "this is {{inline code}}\n" (org-export-string-as "this is ~inline code~" 'jira)))
(should (equal "this is {{verbatim}} text\n" (org-export-string-as "this is =verbatim= text" 'jira))))