Pārlūkot izejas kodu

Revert "element: Un-escape code in inline source blocks"

This reverts commit 4056e11ddcb712e9e65cefdefed407ec197ffedf.

We shouldn't code escape inline source blocks, as escaping can be
inlined any time, at which point escape character is no longer treated
specially. E.g.,

    src_c{a
    ,* 2}

may become

    src_c{a ,* a}

where the comma is no longer an escape character.
Nicolas Goaziou 3 gadi atpakaļ
vecāks
revīzija
5d5d102254
2 mainītis faili ar 2 papildinājumiem un 7 dzēšanām
  1. 2 2
      lisp/org-element.el
  2. 0 5
      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 (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
 

+ 0 - 5
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"