0
0
Fork 1
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-09-30 02:30:03 +00:00

ox-texinfo: Fix heading text

* lisp/ox-texinfo.el (org-texinfo-headline): Do not sanitize heading
  text for sectioning command.

For example

  * This is ~code~

should be possibly exported as

  @chapter This is @code{code}

not

  @chapter This is @@code@{code@}
This commit is contained in:
Nicolas Goaziou 2014-08-09 00:43:39 +02:00
parent 1faeb4e680
commit 710e40f96a

View file

@ -915,16 +915,13 @@ holding contextual information."
(level (org-export-get-relative-level headline info)) (level (org-export-get-relative-level headline info))
(numberedp (org-export-numbered-headline-p headline info)) (numberedp (org-export-numbered-headline-p headline info))
(class-sectioning (assoc class org-texinfo-classes)) (class-sectioning (assoc class org-texinfo-classes))
;; Find the index type, if any ;; Find the index type, if any.
(index (org-element-property :INDEX headline)) (index (org-element-property :INDEX headline))
;; Retrieve headline text
(text (org-texinfo--sanitize-headline
(org-element-property :title headline) info))
;; Create node info, to insert it before section formatting. ;; Create node info, to insert it before section formatting.
;; Use custom menu title if present ;; Use custom menu title if present.
(node (format "@node %s\n" (org-texinfo--get-node headline info))) (node (format "@node %s\n" (org-texinfo--get-node headline info)))
;; Menus must be generated with first child, otherwise they ;; Menus must be generated with first child, otherwise they
;; will not nest properly ;; will not nest properly.
(menu (let* ((first (org-export-first-sibling-p headline info)) (menu (let* ((first (org-export-first-sibling-p headline info))
(parent (org-export-get-parent-headline headline)) (parent (org-export-get-parent-headline headline))
(title (org-texinfo--sanitize-headline (title (org-texinfo--sanitize-headline
@ -975,33 +972,33 @@ holding contextual information."
(org-export-get-tags headline info))) (org-export-get-tags headline info)))
(priority (and (plist-get info :with-priority) (priority (and (plist-get info :with-priority)
(org-element-property :priority headline))) (org-element-property :priority headline)))
;; Retrieve headline text for structuring command.
(text (org-export-data (org-element-property :title headline) info))
;; Create the headline text along with a no-tag version. The ;; Create the headline text along with a no-tag version. The
;; latter is required to remove tags from table of contents. ;; latter is required to remove tags from table of contents.
(full-text (org-texinfo--sanitize-content (full-text (if (not (eq org-texinfo-format-headline-function 'ignore))
(if (not (eq org-texinfo-format-headline-function 'ignore)) ;; User-defined formatting function.
;; User-defined formatting function. (funcall org-texinfo-format-headline-function
(funcall org-texinfo-format-headline-function todo todo-type priority text tags)
todo todo-type priority text tags) ;; Default formatting.
;; Default formatting. (concat
(concat (when todo
(when todo (format "@strong{%s} " todo))
(format "@strong{%s} " todo)) (when priority (format "@emph{#%s} " priority))
(when priority (format "@emph{#%s} " priority)) text
text (when tags
(when tags (format " :%s:"
(format " :%s:" (mapconcat 'identity tags ":"))))))
(mapconcat 'identity tags ":")))))))
(full-text-no-tag (full-text-no-tag
(org-texinfo--sanitize-content (if (not (eq org-texinfo-format-headline-function 'ignore))
(if (not (eq org-texinfo-format-headline-function 'ignore)) ;; User-defined formatting function.
;; User-defined formatting function. (funcall org-texinfo-format-headline-function
(funcall org-texinfo-format-headline-function todo todo-type priority text nil)
todo todo-type priority text nil) ;; Default formatting.
;; Default formatting. (concat
(concat (when todo (format "@strong{%s} " todo))
(when todo (format "@strong{%s} " todo)) (when priority (format "@emph{#%c} " priority))
(when priority (format "@emph{#%c} " priority)) text)))
text))))
(pre-blanks (pre-blanks
(make-string (org-element-property :pre-blank headline) 10))) (make-string (org-element-property :pre-blank headline) 10)))
(cond (cond