forked from mirrors/org-mode
Update tests and comments for new snippet syntax
* contrib/lisp/org-export.el (org-export-snippet-translation-alist): Fix docstring. (org-export-as): Fix code comment. * testing/lisp/test-org-element.el: Update tests. * testing/lisp/test-org-export.el: Update tests.
This commit is contained in:
parent
2e38ed36cb
commit
ab82a9dcfe
|
@ -641,9 +641,9 @@ confirm the use of these lines."
|
||||||
|
|
||||||
This variable allows to provide shortcuts for export snippets.
|
This variable allows to provide shortcuts for export snippets.
|
||||||
|
|
||||||
For example, with a value of '\(\(\"h\" . \"html\"\)\), the HTML
|
For example, with a value of '\(\(\"h\" . \"e-html\"\)\), the
|
||||||
back-end will recognize the contents of \"@h{<b>}\" as HTML code
|
HTML back-end will recognize the contents of \"@@h:<b>@@\" as
|
||||||
while every other back-end will ignore it."
|
HTML code while every other back-end will ignore it."
|
||||||
:group 'org-export-general
|
:group 'org-export-general
|
||||||
:type '(repeat
|
:type '(repeat
|
||||||
(cons
|
(cons
|
||||||
|
@ -2320,10 +2320,8 @@ Return code as a string."
|
||||||
(goto-char (point-min))
|
(goto-char (point-min))
|
||||||
(forward-line)
|
(forward-line)
|
||||||
(narrow-to-region (point) (point-max))))
|
(narrow-to-region (point) (point-max))))
|
||||||
;; 1. Get export environment from original buffer. Store
|
;; 1. Get export environment from original buffer. Also install
|
||||||
;; original footnotes definitions in communication channel as
|
;; user's and developer's filters.
|
||||||
;; they might not be accessible anymore in a narrowed parse
|
|
||||||
;; tree. Also install user's and developer's filters.
|
|
||||||
(let ((info (org-export-install-filters
|
(let ((info (org-export-install-filters
|
||||||
(org-export-get-environment backend subtreep ext-plist)))
|
(org-export-get-environment backend subtreep ext-plist)))
|
||||||
;; 2. Get parse tree. Buffer isn't parsed directly.
|
;; 2. Get parse tree. Buffer isn't parsed directly.
|
||||||
|
|
|
@ -470,7 +470,7 @@ CLOCK: [2012-01-01 sun. 00:01]--[2012-01-01 sun. 00:02] => 0:01"
|
||||||
(should
|
(should
|
||||||
(equal
|
(equal
|
||||||
'("back-end" . "contents")
|
'("back-end" . "contents")
|
||||||
(org-test-with-temp-text "<back-end@contents>"
|
(org-test-with-temp-text "@@back-end:contents@@"
|
||||||
(org-element-map
|
(org-element-map
|
||||||
(org-element-parse-buffer) 'export-snippet
|
(org-element-parse-buffer) 'export-snippet
|
||||||
(lambda (snippet) (cons (org-element-property :back-end snippet)
|
(lambda (snippet) (cons (org-element-property :back-end snippet)
|
||||||
|
@ -1758,8 +1758,8 @@ CLOSED: <2012-01-01> DEADLINE: <2012-01-01> SCHEDULED: <2012-01-01>\n"))))
|
||||||
|
|
||||||
(ert-deftest test-org-element/export-snippet-interpreter ()
|
(ert-deftest test-org-element/export-snippet-interpreter ()
|
||||||
"Test export snippet interpreter."
|
"Test export snippet interpreter."
|
||||||
(should (equal (org-test-parse-and-interpret "<back-end@contents>")
|
(should (equal (org-test-parse-and-interpret "@@back-end:contents@@")
|
||||||
"<back-end@contents>\n")))
|
"@@back-end:contents@@\n")))
|
||||||
|
|
||||||
(ert-deftest test-org-element/footnote-reference-interpreter ()
|
(ert-deftest test-org-element/footnote-reference-interpreter ()
|
||||||
"Test footnote reference interpreter."
|
"Test footnote reference interpreter."
|
||||||
|
|
|
@ -295,7 +295,7 @@ Paragraph"
|
||||||
|
|
||||||
(ert-deftest test-org-export/export-snippet ()
|
(ert-deftest test-org-export/export-snippet ()
|
||||||
"Test export snippets transcoding."
|
"Test export snippets transcoding."
|
||||||
(org-test-with-temp-text "<test@A><t@B>"
|
(org-test-with-temp-text "@@test:A@@@@t:B@@"
|
||||||
(org-test-with-backend test
|
(org-test-with-backend test
|
||||||
(flet ((org-test-export-snippet
|
(flet ((org-test-export-snippet
|
||||||
(snippet contents info)
|
(snippet contents info)
|
||||||
|
|
Loading…
Reference in a new issue