forked from mirrors/org-mode
Revert "element: Un-escape code in inline source blocks"
This reverts commit 4056e11ddc
.
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.
This commit is contained in:
parent
6dbd132e62
commit
5d5d102254
|
@ -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
|
||||
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Reference in New Issue