mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-11-22 07:09:47 +00:00
org-element: Properly unescape data in export blocks
* lisp/org-element.el (org-element-export-block-parser): Remove commas in export blocks. * testing/lisp/test-org-element.el (test-org-element/export-block-parser): Add test.
This commit is contained in:
parent
1fd6f28157
commit
a540e894b6
@ -1992,8 +1992,9 @@ Assume point is at export-block beginning."
|
||||
(point)))
|
||||
(end (progn (skip-chars-forward " \r\t\n" limit)
|
||||
(if (eobp) (point) (line-beginning-position))))
|
||||
(value (buffer-substring-no-properties contents-begin
|
||||
contents-end)))
|
||||
(value (org-unescape-code-in-string
|
||||
(buffer-substring-no-properties contents-begin
|
||||
contents-end))))
|
||||
(list 'export-block
|
||||
(nconc
|
||||
(list :type (and backend (upcase backend))
|
||||
|
@ -836,7 +836,12 @@ Some other text
|
||||
;; Handle non-empty blank line at the end of buffer.
|
||||
(should
|
||||
(org-test-with-temp-text "#+BEGIN_EXPORT latex\nC\n#+END_EXPORT\n "
|
||||
(= (org-element-property :end (org-element-at-point)) (point-max)))))
|
||||
(= (org-element-property :end (org-element-at-point)) (point-max))))
|
||||
;; Un-escape commas in `:value'.
|
||||
(should
|
||||
(equal "* H\n"
|
||||
(org-test-with-temp-text "#+BEGIN_EXPORT org\n,* H\n#+END_EXPORT\n "
|
||||
(org-element-property :value (org-element-at-point))))))
|
||||
|
||||
|
||||
;;;; Export Snippet
|
||||
|
Loading…
Reference in New Issue
Block a user