@@ -247,6 +247,7 @@ version. If nil, no checks are performed and no warnings generated."
247247(org-export-define-derived-backend 'pandoc 'org
248248 :translate-alist '((entity . org-pandoc-entity)
249249 (export-block . org-pandoc-export-block)
250+ (export-snippet . org-pandoc-export-snippet)
250251 (latex-environment . org-pandoc-latex-environ)
251252 (link . org-pandoc-link)
252253 (paragraph . org-pandoc-paragraph)
@@ -1752,9 +1753,24 @@ contextual information."
17521753 " Transcode a EXPORT-BLOCK element from Org to Pandoc.
17531754This might be EXPORT_HTML or EXPORT_LATEX, and is simply
17541755duplicated into the temporary org file that pandoc converts.
1755- CONTENTS is the contents of the block. INFO is a plist holding
1756- contextual information."
1757- (org-pandoc-identity export-block contents info))
1756+ Special: if the block is BEGIN_EXPORT pandoc, pass the value to
1757+ pandoc. CONTENTS is the contents of the block. INFO is a plist
1758+ holding contextual information."
1759+ (if (string= (org-element-property :type export-block) " PANDOC" )
1760+ (org-element-property :value export-block)
1761+ (org-pandoc-identity export-block contents info)))
1762+
1763+ (defun org-pandoc-export-snippet (export-snippet contents info )
1764+ " Transcode a @@format:snippet@@ from Org to Pandoc.
1765+ If it is an output format, such as latex or html, the snippet is
1766+ duplicated in full for pandoc to handle as Org's own exporters
1767+ would. If the snippet specifies 'pandoc' as the format, the inner
1768+ content of the snippet is passed to pandoc. CONTENTS is the
1769+ contents of the block. INFO is a plist holding contextual
1770+ information."
1771+ (if (eq (org-export-snippet-backend export-snippet) 'pandoc )
1772+ (org-element-property :value export-snippet)
1773+ (org-pandoc-identity export-snippet contents info)))
17581774
17591775(defun org-pandoc-identity (blob contents _info )
17601776 " Transcode BLOB element or object back into Org syntax.
0 commit comments