diff --git a/contrib/lisp/org-export-generic.el b/contrib/lisp/org-export-generic.el index 1b099dd..88c6169 100644 --- a/contrib/lisp/org-export-generic.el +++ b/contrib/lisp/org-export-generic.el @@ -473,6 +473,8 @@ The prefix ARG specifies how many levels of the outline should become underlined headlines. The default is 3." (interactive "P") (setq-default org-todo-line-regexp org-todo-line-regexp) + (unwind-protect + (add-hook 'org-export-preprocess-hook 'org-export-generic-process-markup) (let* ((opt-plist (org-combine-plists (org-default-export-plist) (org-infile-export-plist))) (region-p (org-region-active-p)) @@ -541,6 +543,8 @@ underlined headlines. The default is 3." (if (equal ass "default") org-generic-export-type ass) org-generic-alist)))) + (markup-table (plist-get export-plist :markup)) ; Need this early + (custom-times org-display-custom-times) (org-generic-current-indentation '(0 . 0)) (level 0) (old-level 0) line txt lastwastext @@ -1021,8 +1025,23 @@ underlined headlines. The default is 3." (setq end (next-single-property-change beg 'org-cwidth)) (delete-region beg end) (goto-char beg))) - (goto-char (point-min)))) + (goto-char (point-min))) + ;; Unwind: + (remove-hook 'org-export-preprocess-hook 'org-export-generic-process-markup))) +(defun org-export-generic-process-markup () + (save-excursion + (goto-char (point-min)) + (while (re-search-forward org-emph-re nil t) + (let* ((mpre (match-string 1)) ; match prefix... + (msuf (match-string 5)) ; and suffix: leave alone + (mchar (match-string 3)) ; org's "markup charater" + (mtext (match-string 4)) ; the marked-up text + (fmt (or (cdr (assoc mchar markup-table)) ; found? + (concat mchar "%s" mchar)))) ; no: leave alone + (replace-match + (format (concat "%s" fmt "%s") mpre mtext msuf))) + (backward-char)))) (defun org-export-generic-format (export-plist prop &optional len n reverse) "converts a property specification to a string given types of properties