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

Fix markup problems when using references in source fragments

* lisp/org-exp.el (org-remove-formatting-on-newlines-in-region): New function.
(org-export-format-source-code-or-example): Call
`org-remove-formatting-on-newlines-in-region'.

TINYCHANGE
This commit is contained in:
Roland Kaufmann 2011-05-12 00:41:20 +00:00 committed by Carsten Dominik
parent 34fa86edf5
commit 33bae13aeb

View file

@ -2446,6 +2446,15 @@ in the list) and remove property and value from the list in LISTVAR."
(defvar org-export-latex-listings-options) ;; defined in org-latex.el
(defvar org-export-latex-minted-options) ;; defined in org-latex.el
(defun org-remove-formatting-on-newlines-in-region (beg end)
"Remove formatting on newline characters"
(interactive "r")
(save-excursion
(goto-char beg)
(while (progn (end-of-line) (< (point) end))
(put-text-property (point) (1+ (point)) 'face nil)
(forward-char 1))))
(defun org-export-format-source-code-or-example
(lang code &optional opts indent caption)
"Format CODE from language LANG and return it formatted for export.
@ -2532,6 +2541,8 @@ INDENT was the original indentation of the block."
(funcall mode)
(fundamental-mode))
(font-lock-fontify-buffer)
;; markup each line separately
(org-remove-formatting-on-newlines-in-region (point-min) (point-max))
(org-src-mode)
(set-buffer-modified-p nil)
(org-export-htmlize-region-for-paste