From mboxrd@z Thu Jan 1 00:00:00 1970 From: sand@blarg.net Subject: Bugfix for org-export-format-source-code-or-example Date: Fri, 19 Jun 2009 22:29:59 -0700 Message-ID: <19004.29655.513168.584209@priss.frightenedpiglet.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="sEhPvs1Sm/" Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MHtAT-0004Kq-2m for emacs-orgmode@gnu.org; Sat, 20 Jun 2009 01:31:09 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MHtAO-0004Gy-5x for emacs-orgmode@gnu.org; Sat, 20 Jun 2009 01:31:08 -0400 Received: from [199.232.76.173] (port=45922 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MHtAN-0004Gj-Po for emacs-orgmode@gnu.org; Sat, 20 Jun 2009 01:31:03 -0400 Received: from v-static-143-234.avvanta.com ([206.124.143.234]:44538 helo=priss.frightenedpiglet.com) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1MHtAN-0005m1-44 for emacs-orgmode@gnu.org; Sat, 20 Jun 2009 01:31:03 -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@gnu.org --sEhPvs1Sm/ Content-Type: text/plain; charset=us-ascii Content-Description: message body text Content-Transfer-Encoding: 7bit I switched my 'org-export-html-extension' variable from "html" to "xhtml" and found that code examples are being formatted incorrectly. I use Firefox, and when Firefox has (what it thinks is) HTML-in-XML, it uses Standards Mode. This happens: - if you get the document from a server and its MIME type is "application/xhtml+xml", or - if you get the document from a file, and its extension is ".xhtml". Otherwise it uses Quirks mode. In Standards mode, Firefox attempts to render everything per the spec. In Quirks mode, Firefox is being backwards compatible with legacy browsers. (I'm ignoring Almost Standards mode here.) The current master repo generates HTML like
  Quote paragraph 1.

  Quote paragraph 2.

  Quote paragraph 3.
  
which Firefox displays as we expect in Quirks mode. In Standards mode, Firefox adds an extra blank line before the "Quote paragraph 1." This comes from Firefox presenting the newline that Org Mode has inserted between the first ">" and the text. This blank line is very obvious in the browser, because the sample has an enclosing box. When I manually remove the newlines, both XHTML and HTML modes look correct, so I have created a patch (attached) to remove the newlines after the "pre". This fixes the XHTML display problem. The ASCII exporter looks fine after the change, and I can't see any difference in what the LaTeX and Docbook exporters generate. (Why am I bothering with XHTML in the first place? To embed SVG elements.) Derek -- Derek Upham sand@blarg.net --sEhPvs1Sm/ Content-Type: text/plain; name="pre-newline.patch" Content-Description: Patch to remove incorrect newline when generating "pre" Content-Disposition: inline; filename="pre-newline.patch" Content-Transfer-Encoding: 7bit diff --git a/lisp/org-exp.el b/lisp/org-exp.el index 6d8dd4a..5412e1b 100644 --- a/lisp/org-exp.el +++ b/lisp/org-exp.el @@ -2228,7 +2228,7 @@ INDENT was the original indentation of the block." (point-min) (point-max)))) (if (string-match "]*\\)>\n?" rtn) (setq rtn (replace-match - (format "
\n" lang)
+				   (format "
" lang)
 				   t t rtn))))
 		(if textareap
 		    (setq rtn (concat
@@ -2243,7 +2243,7 @@ INDENT was the original indentation of the block."
 						'((?&."&")(?<."<")(?>.">"))))
 				     t t))
 		    (setq rtn (buffer-string)))
-		  (setq rtn (concat "
\n" rtn "
\n")))) + (setq rtn (concat "
" rtn "
\n")))) (unless textareap (setq rtn (org-export-number-lines rtn 'html 1 1 num cont rpllbl fmt))) --sEhPvs1Sm/ 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 --sEhPvs1Sm/--