Browse Source

Merge branch 'maint'

Nicolas Goaziou 3 years ago
parent
commit
b049f839b0
2 changed files with 7 additions and 2 deletions
  1. 2 2
      lisp/org-element.el
  2. 5 0
      testing/lisp/test-org-element.el

+ 2 - 2
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 value
+		      :value (org-unescape-code-in-string 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) "")
-	    body)))
+	    (org-trim (org-escape-code-in-string body)))))
 
 ;;;; Italic
 

+ 5 - 0
testing/lisp/test-org-element.el

@@ -1288,6 +1288,11 @@ 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"