diff options
| author | Stig Brautaset <sbrautaset@laterpay.net> | 2016-04-13 11:02:24 +0100 |
|---|---|---|
| committer | Stig Brautaset <sbrautaset@laterpay.net> | 2016-04-26 12:22:33 +0100 |
| commit | 8cc6901da2f84b39ef027250ad18afda69bfc4b3 (patch) | |
| tree | 291a688346d0974863c4f44eb29286d207a1a1a5 | |
| parent | 9cad50c3c383bea6fb2d185fca123c0593e062fd (diff) | |
Remove language when it is not known
Rather than use {code:none}, just use {code}
| -rw-r--r-- | ox-jira.el | 12 | ||||
| -rw-r--r-- | ox-jira.org | 12 | ||||
| -rw-r--r-- | test/ox-jira-test.org | 6 |
3 files changed, 16 insertions, 14 deletions
@@ -305,12 +305,14 @@ CONTENTS holds the contents of the src-block. INFO is a plist holding contextual information." (when (org-string-nw-p (org-element-property :value src-block)) (let* ((lang (org-element-property :language src-block)) - (lang (if (member lang '("actionscript" "html" "java" "javascript" "sql" "xhtml" "xml")) - lang "none")) + (lang (if (member lang '("actionscript" "html" "java" "javascript" "sql" "xhtml" "xml")) lang)) (code (org-export-format-code-default src-block info))) - (format "{code:%s}\n%s{code}" - lang - code)))) + (concat + (if lang + (format "{code:%s}" lang) + "{code}") + code + "{code}")))) (defun ox-jira-subscript (subscript contents info) "Transcode SUBSCRIPT from Org to JIRA. diff --git a/ox-jira.org b/ox-jira.org index 5b6f44b..1d66afb 100644 --- a/ox-jira.org +++ b/ox-jira.org @@ -550,12 +550,14 @@ contextual information." (when (org-string-nw-p (org-element-property :value src-block)) (let* ((lang (org-element-property :language src-block)) - (lang (if (member lang '("actionscript" "html" "java" "javascript" "sql" "xhtml" "xml")) - lang "none")) + (lang (if (member lang '("actionscript" "html" "java" "javascript" "sql" "xhtml" "xml")) lang)) (code (org-export-format-code-default src-block info))) - (format "{code:%s}\n%s{code}" - lang - code)))) + (concat + (if lang + (format "{code:%s}" lang) + "{code}") + code + "{code}")))) #+END_SRC *** Subscript diff --git a/test/ox-jira-test.org b/test/ox-jira-test.org index af9c12e..1778b80 100644 --- a/test/ox-jira-test.org +++ b/test/ox-jira-test.org @@ -295,8 +295,7 @@ #+BEGIN_SRC emacs-lisp (ert-deftest ox-jira-test/src-blocks () - (should (equal "{code:none} - echo hello + (should (equal "{code}echo hello # echo world {code} " (org-export-string-as "#+begin_src sh @@ -304,8 +303,7 @@ # echo world ,#+end_src " 'jira))) - (should (equal "{code:sql} - BEGIN; + (should (equal "{code:sql}BEGIN; SELECT NOW(); END; {code} |
