Change the dot in section numbers to underscore, to get valid CSS class names

This commit is contained in:
Carsten Dominik 2010-04-24 14:14:15 +02:00
parent 0340cf14b7
commit f357e5f644
2 changed files with 12 additions and 3 deletions

View File

@ -1,5 +1,9 @@
2010-04-24 Carsten Dominik <carsten.dominik@gmail.com>
* org-html.el (org-export-as-html, org-html-level-start):
Change the dot in section numbers to underscore, to get valid
CSS class names.
* org-table.el (org-table-justify-field-maybe): Make sure that
inserting a value does not turn a line into a hline.

View File

@ -871,7 +871,9 @@ lang=\"%s\" xml:lang=\"%s\">
t t line)))
(while (string-match "&lt;\\(&lt;\\)+\\|&gt;\\(&gt;\\)+" txt)
(setq txt (replace-match "" t t txt)))
(setq href (format "sec-%s" snumber))
(setq href
(replace-regexp-in-string
"\\." "_" (format "sec-%s" snumber)))
(setq href (or (cdr (assoc href org-export-preferred-target-alist)) href))
(push
(format
@ -2085,8 +2087,11 @@ When TITLE is nil, just close all open levels."
" " title)))
(unless (= head-count 1) (insert "\n</div>\n"))
(setq href (cdr (assoc (concat "sec-" snumber) org-export-preferred-target-alist)))
(setq suffix (or href snumber))
(setq href (or href (concat "sec-" snumber)))
(setq suffix (or href
(replace-regexp-in-string "\\." "_" snumber)))
(setq href (or href
(replace-regexp-in-string
"\\." "_" (concat "sec-" snumber))))
(insert (format "\n<div id=\"outline-container-%s\" class=\"outline-%d%s\">\n<h%d id=\"%s\">%s%s</h%d>\n<div class=\"outline-text-%d\" id=\"text-%s\">\n"
suffix level (if extra-class (concat " " extra-class) "")
level href