From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sebastian Rose Subject: Valid xhtml and org-html.el Date: Mon, 04 May 2009 11:18:57 +0200 Message-ID: <87skjldy4e.fsf@kassiopeya.MSHEIMNETZ> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1M0uGj-0008G0-9D for emacs-orgmode@gnu.org; Mon, 04 May 2009 05:15:25 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M0uGe-00089a-7g for emacs-orgmode@gnu.org; Mon, 04 May 2009 05:15:24 -0400 Received: from [199.232.76.173] (port=46213 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M0uGd-00089H-Rc for emacs-orgmode@gnu.org; Mon, 04 May 2009 05:15:19 -0400 Received: from mail.gmx.net ([213.165.64.20]:45995) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1M0uGd-00046T-CA for emacs-orgmode@gnu.org; Mon, 04 May 2009 05:15:19 -0400 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode Mailing List --=-=-= Hi, appended is a patch for org-html.el. This is what it does: 1. is no valid XHTML. Coltags must be empty. I.e., 2. ... tags where missing 3. A minor fix for the end of the CSS comments. Safari doesn't like /*]]>*///--> and is right in this case. `//' does not start a comment in CSS. Therefore, I changed it to /*]]>*/--> which is valid and Safari shuts up. 4. Change `&' in link descriptions to `&' again. Not sure if I did it in the right place though, but I guess `org-export-html-format-desc' is only called to format link descriptions. Apropos validation: I worked a little on org-search.php this weekend. It now works without networking by default and is much faster. Also, you may now use it without a database, just to validate the XHTML output. No installation required anymore. In that case, the script just scanns the first 10 files (customizable) found and displays the parser-errors. If you use the script with database, wrong links to images are detected now. That's nice, when moving files around in your org-directories. Get it here: http://github.com/SebastianRose/org-search.php/tree/master --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=all-missing-colgroup-branch.patch diff --git a/lisp/org-html.el b/lisp/org-html.el index 5608b50..8e3ed4e 100644 --- a/lisp/org-html.el +++ b/lisp/org-html.el @@ -123,7 +123,7 @@ not be modified." white-space:nowrap; } .org-info-js_search-highlight {background-color:#ffff00; color:#000000; font-weight:bold; } - /*]]>*///--> + /*]]>*/--> " "The default style specification for exported HTML files. Please use the variables `org-export-html-style' and @@ -1353,10 +1353,10 @@ lang=\"%s\" xml:lang=\"%s\"> (defun org-export-html-format-desc (s) "Make sure the S is valid as a description in a link." - (if (and s (not (get-text-property 1 'org-protected s))) - (save-match-data - (org-html-do-expand s)) - s)) + (save-match-data + (if (and s (not (get-text-property 1 'org-protected s))) + (org-html-do-expand s) + (org-html-protect s)))) (defun org-export-html-format-image (src par-open) "Create image tag with source and attributes." @@ -1492,23 +1492,18 @@ lang=\"%s\" xml:lang=\"%s\"> (setq html (nreverse html)) (unless splice ;; Put in col tags with the alignment (unfortunately often ignored...) - (push (mapconcat - (lambda (x) - (setq gr (pop org-table-colgroup-info)) - (format "%s%s" - (if (memq gr '(:start :startend)) - (prog1 - (if colgropen "\n" "") - (setq colgropen t)) - "") + (push (concat + "" + (mapconcat + (lambda (x) + (setq gr (pop org-table-colgroup-info)) + (format "" (if (> (/ (float x) nlines) org-table-number-fraction) - "right" "left") - (if (memq gr '(:end :startend)) - (progn (setq colgropen nil) "") - ""))) - fnum "") + "right" "left"))) + fnum "") + "") html) - (if colgropen (setq html (cons (car html) (cons "" (cdr html))))) + ;; Since the output of HTML table formatter can also be used in ;; DocBook document, we want to always include the caption to make ;; DocBook XML file valid. --=-=-= Regards Sebastian --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --=-=-=--