summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2021-04-13 09:56:16 +0200
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2021-04-13 09:56:16 +0200
commit4941444f45adebeab61259625fa69275acee03f0 (patch)
tree303d25e9d387ebf767aef03771eeabcbd12b2d65
parentb33face41c6b4fbd96d127b56b19bbb5f33e34ce (diff)
parentbcc1b0f1bb8e7b468d2848c7e5216948bb1948a6 (diff)
downloadorg-mode-4941444f45adebeab61259625fa69275acee03f0.tar.gz
Merge branch 'maint'
-rw-r--r--lisp/ob-exp.el7
-rw-r--r--lisp/org-element.el4
-rw-r--r--testing/lisp/test-ob-exp.el8
-rw-r--r--testing/lisp/test-org-element.el5
4 files changed, 15 insertions, 9 deletions
diff --git a/lisp/ob-exp.el b/lisp/ob-exp.el
index c579080..e9b304b 100644
--- a/lisp/ob-exp.el
+++ b/lisp/ob-exp.el
@@ -360,9 +360,12 @@ replaced with its value."
(org-fill-template
(if (eq type 'inline)
org-babel-exp-inline-code-template
- org-babel-exp-code-template)
+ org-babel-exp-code-template)
`(("lang" . ,(nth 0 info))
- ("body" . ,(org-escape-code-in-string (nth 1 info)))
+ ;; Inline source code should not be escaped.
+ ("body" . ,(let ((body (nth 1 info)))
+ (if (eq type 'inline) body
+ (org-escape-code-in-string body))))
("switches" . ,(let ((f (nth 3 info)))
(and (org-string-nw-p f) (concat " " f))))
("flags" . ,(let ((f (assq :flags (nth 2 info))))
diff --git a/lisp/org-element.el b/lisp/org-element.el
index f952cf0..5bac89e 100644
--- a/lisp/org-element.el
+++ b/lisp/org-element.el
@@ -2980,7 +2980,7 @@ Assume point is at the beginning of the inline source block."
(post-blank (skip-chars-forward " \t")))
(list 'inline-src-block
(list :language language
- :value (org-unescape-code-in-string value)
+ :value value
:parameters parameters
:begin begin
:end (point)
@@ -2994,7 +2994,7 @@ Assume point is at the beginning of the inline source block."
(format "src_%s%s{%s}"
language
(if arguments (format "[%s]" arguments) "")
- (org-trim (org-escape-code-in-string body)))))
+ body)))
;;;; Italic
diff --git a/testing/lisp/test-ob-exp.el b/testing/lisp/test-ob-exp.el
index 3aeb13f..6cd7514a 100644
--- a/testing/lisp/test-ob-exp.el
+++ b/testing/lisp/test-ob-exp.el
@@ -213,6 +213,14 @@ Here is one at the end of a line. {{{results(=2=)}}}
(org-export-use-babel t))
(org-babel-exp-process-buffer))
(buffer-string))))
+ ;; Do not escape characters in inline source blocks.
+ (should
+ (equal "src_c[]{*a}"
+ (org-test-with-temp-text "src_c[ :exports code ]{*a}"
+ (let ((org-babel-inline-result-wrap "=%s=")
+ (org-export-use-babel t))
+ (org-babel-exp-process-buffer))
+ (buffer-string))))
(should
(equal "src_emacs-lisp[]{(+ 1 1)} {{{results(=2=)}}}"
(org-test-with-temp-text "src_emacs-lisp[:exports both]{(+ 1 1)}"
diff --git a/testing/lisp/test-org-element.el b/testing/lisp/test-org-element.el
index 096a65d..9003b3c 100644
--- a/testing/lisp/test-org-element.el
+++ b/testing/lisp/test-org-element.el
@@ -1288,11 +1288,6 @@ Some other text
(eq 'inline-src-block
(org-test-with-temp-text "src_emacs-lisp[:foo\nbar]{(+ 1 1)}"
(org-element-type (org-element-context)))))
- ;; Properly un-escape code.
- (should
- (equal "(\n* 1 2)"
- (org-test-with-temp-text "src_emacs-lisp[:foo bar]{(\n,* 1 2)}"
- (org-element-property :value (org-element-context)))))
;; Besides curly brackets, ignore any other bracket type.
(should
(equal "[foo"