mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-12-26 10:49:38 +00:00
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.
This commit is contained in:
parent
7513f16182
commit
3e10bab25a
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user