From 3e10bab25a80c7431d0a97f0dd4ea3f1785959e5 Mon Sep 17 00:00:00 2001 From: Jonathan Leech-Pepin Date: Sun, 10 Mar 2013 15:32:46 -0400 Subject: [PATCH] lisp/ox-texinfo.el: Fix export of source blocks * lisp/ox-texinfo.el (org-texinfo-src-block): Escape texinfo commands within source blocks to ensure proper export. `@ { }' all need to be escaped to ensure proper formatting when processing to info. --- lisp/ox-texinfo.el | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lisp/ox-texinfo.el b/lisp/ox-texinfo.el index bec2984dd..aafd74b83 100644 --- a/lisp/ox-texinfo.el +++ b/lisp/ox-texinfo.el @@ -1431,16 +1431,18 @@ as a communication channel." CONTENTS holds the contents of the item. INFO is a plist holding contextual information." (let* ((lang (org-element-property :language src-block)) - (lisp-p (string-match-p "lisp" lang))) + (lisp-p (string-match-p "lisp" lang)) + (src-contents (org-texinfo--sanitize-content + (org-export-format-code-default src-block info)))) (cond ;; Case 1. Lisp Block (lisp-p (format "@lisp\n%s@end lisp" - (org-export-format-code-default src-block info))) + src-contents)) ;; Case 2. Other blocks (t (format "@example\n%s@end example" - (org-export-format-code-default src-block info)))))) + src-contents))))) ;;; Statistics Cookie