1
0
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:
Nicolas Goaziou 2016-05-13 17:53:22 +02:00
parent 1fd6f28157
commit a540e894b6
2 changed files with 9 additions and 3 deletions

View File

@ -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))

View File

@ -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