I am attaching a partial patch (see below for explanation of partial) along with sample files, I hope others here can help finish this.
Goal: Produce well-formed XHTML. What I have Fixed: 0) Ensure all tagnames are lower case. 1) Emit correct doctype and xhtml namespace. 2) Emit /> to close meta tags. 3) Emit </li> to close bullets (not all cases covered) 4) Ensured that all attribute values are quoted. ToDo: A) Emit closing li tags in all cases. B) Emit closing </p> to close paragraphs. C) Ensure that author and date bits on the bottom are wrapped in a <p class="xxx">...</p> where xxx is author or date as appropriate. I'm attaching a bullets.org file, and the final xhtml output I'd like to produce. *** org.el 2006/05/26 01:29:49 1.1 --- org.el 2006/05/26 01:57:39 *************** *** 12609,12634 **** ;; File header (insert (format ! "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\" ! \"http://www.w3.org/TR/REC-html40/loose.dtd\"> ! <html lang=\"%s\"><head> <title>%s</title> ! <meta http-equiv=\"Content-Type\" content=\"text/html;charset=%s\"> ! <meta name=generator content=\"Org-mode\"> ! <meta name=generated content=\"%s %s\"> ! <meta name=author content=\"%s\"> %s </head><body> " ! language (org-html-expand title) (or charset "iso-8859-1") date time author style)) (insert (or (plist-get opt-plist :preamble) "")) (when (plist-get opt-plist :auto-preamble) ! (if title (insert (concat "<H1 class=\"title\">" ! (org-html-expand title) "</H1>\n"))) ; (if author (insert (concat (nth 1 lang-words) ": " author "\n"))) ; (if email (insert (concat "<a href=\"mailto:" email "\"><" ; email "></a>\n"))) --- 12609,12636 ---- ;; File header (insert (format ! "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" ! \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\"> ! <html xmlns=\"http://www.w3.org/1999/xhtml\" ! lang=\"%s\" xml:lang=\"%s\"> ! <head> <title>%s</title> ! <meta http-equiv=\"Content-Type\" content=\"text/html;charset=%s\"/> ! <meta name=\"generator\" content=\"Org-mode\"/> ! <meta name=\"generated\" content=\"%s %s\"/> ! <meta name=\"author\" content=\"%s\"/> %s </head><body> " ! language language (org-html-expand title) (or charset "iso-8859-1") date time author style)) (insert (or (plist-get opt-plist :preamble) "")) (when (plist-get opt-plist :auto-preamble) ! (if title (insert (concat "<h1 class=\"title\">" ! (org-html-expand title) "</h1>\n"))) ; (if author (insert (concat (nth 1 lang-words) ": " author "\n"))) ; (if email (insert (concat "<a href=\"mailto:" email "\"><" ; email "></a>\n"))) *************** *** 12639,12645 **** (if org-export-with-toc (progn ! (insert (format "<H2>%s</H2>\n" (nth 3 lang-words))) (insert "<ul>\n") (setq lines (mapcar '(lambda (line) --- 12641,12647 ---- (if org-export-with-toc (progn ! (insert (format "<h2>%s</h2>\n" (nth 3 lang-words))) (insert "<ul>\n") (setq lines (mapcar '(lambda (line) *************** *** 12694,12700 **** (insert (format (if todo ! "<li><a href=\"#sec-%d\"><span class=\"todo\">%s</span></a>\n" "<li><a href=\"#sec-%d\">%s</a>\n") head-count txt)) --- 12696,12702 ---- (insert (format (if todo ! "<li><a href=\"#sec-%d\"><span class=\"todo\">%s</span></a></li>\n" "<li><a href=\"#sec-%d\">%s</a>\n") head-count txt)) *************** *** 13254,13260 **** (if (aref levels-open (1- level)) (insert "<li>" title "<p>\n") (aset levels-open (1- level) t) ! (insert "<ul><li>" title "<p>\n"))) (if org-export-with-section-numbers (setq title (concat (org-section-number level) " " title))) (setq level (+ level 1)) --- 13256,13262 ---- (if (aref levels-open (1- level)) (insert "<li>" title "<p>\n") (aset levels-open (1- level) t) ! (insert "<ul><li>" title "</li>\n"))) (if org-export-with-section-numbers (setq title (concat (org-section-number level) " " title))) (setq level (+ level 1)) *************** *** 13272,13280 **** "") t t title))) (if with-toc ! (insert (format "\n<H%d><a name=\"sec-%d\">%s</a></H%d>\n" level head-count title level)) ! (insert (format "\n<H%d>%s</H%d>\n" level title level))))))) (defun org-html-level-close (&rest args) "Terminate one level in HTML export." --- 13274,13282 ---- "") t t title))) (if with-toc ! (insert (format "\n<h%d><a name=\"sec-%d\">%s</a></h%d>\n" level head-count title level)) ! (insert (format "\n<h%d>%s</h%d>\n" level title level))))))) (defun org-html-level-close (&rest args) "Terminate one level in HTML export."
bullets.org
Description: input org file
bullets
Table of Contents
1 HTML Export.
this is to test HTML export and move output to XHTML.
- Bulleted list.
- More bullets.
1.1 Subsection
- Another list.
- More things to do.
1.1.1 Numbered Lists:
- First item.
- Second item.
- Third and last item.
Date: 2006/05/25 06:32:18 PM
_______________________________________________ Emacs-orgmode mailing list Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode