diff --git a/lisp/org-docbook.el b/lisp/org-docbook.el index 7c43211..700f1db 100644 --- a/lisp/org-docbook.el +++ b/lisp/org-docbook.el @@ -1259,13 +1259,13 @@ string, don't modify these." (if org-export-with-sub-superscripts (setq s (org-export-docbook-convert-sub-super s))) (if org-export-with-TeX-macros - (let ((start 0) wd rep ass) + (let ((start 0) wd rep) (while (setq start (string-match "\\\\\\([a-zA-Z]+\\)\\({}\\)?" s start)) (if (get-text-property (match-beginning 0) 'org-protected s) (setq start (match-end 0)) (setq wd (match-string 1 s)) - (if (setq ass (org-entity-get-representation wd 'html)) + (if (setq rep (org-entity-get-representation wd 'html)) (setq s (replace-match rep t t s)) (setq start (+ start (length wd)))))))) s) @@ -1349,18 +1349,33 @@ string, don't modify these." (replace-match "")))) (defun org-export-docbook-finalize-table (table) - "Change TABLE to informaltable if caption does not exist. + "Clean up TABLE and turn it into DocBook format. +This function adds a label to the table if it is available, and +also changes TABLE to informaltable if caption does not exist. TABLE is a string containing the HTML code generated by `org-format-table-html' for a table in Org-mode buffer." - (if (string-match - "^\n\\(\\(.\\|\n\\)+\\)
" - table) - (replace-match (concat " element. + (setq table-with-label + (if (string-match + "^\n\\(\\(.\\|\n\\)+\\)
" + table) + (replace-match (concat "") + nil nil table) + table)) + ;; Change
into if caption does not exist. + (if (string-match + "^
\n\\(\\(.\\|\n\\)+\\)
" + table-with-label) + (replace-match (concat "") - nil nil table) - table)) + nil nil table-with-label) + table-with-label))) ;; Note: This function is very similar to ;; org-export-html-convert-sub-super. They can be merged in the future.