emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Rick Frankel <rick@rickster.com>
To: emacs-orgmode@gnu.org
Subject: Re: [PATCH] export to various flavors of (X)HTML
Date: Tue, 30 Apr 2013 10:40:14 -0400	[thread overview]
Message-ID: <d2cc131cca2180893250bd7c0ff21cf6@mail.rickster.com> (raw)
In-Reply-To: <87bo8xeuxd.fsf@ericabrahamsen.net>

[-- Attachment #1: Type: text/plain, Size: 65 bytes --]

Whoops. Wrong key. Patch actually attached to this email...
rick

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Modify-processing-of-xhtml-declaration.patch --]
[-- Type: text/x-lisp; name=0001-Modify-processing-of-xhtml-declaration.patch, Size: 1788 bytes --]

From d95a365f547fdc681c530c9088f775b30a37d9aa Mon Sep 17 00:00:00 2001
From: Rick Frankel <rick@rickster.com>
Date: Tue, 30 Apr 2013 10:35:14 -0400
Subject: [PATCH] Modify processing of xhtml declaration.

* lisp/ox-html.el (org-html-template): If `org-html-xml-declaration'
  is nil or an empty string, don't output a blank line at the head of
  the document. Also, don't ouput the declaration if the document type
  is xhtml5.
---
 lisp/ox-html.el | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/lisp/ox-html.el b/lisp/ox-html.el
index e7cae1a..05b99bf 100644
--- a/lisp/ox-html.el
+++ b/lisp/ox-html.el
@@ -1692,19 +1692,21 @@ holding export options."
 CONTENTS is the transcoded contents string.  INFO is a plist
 holding export options."
   (concat
-   (when (org-html-xhtml-p info)
-     (format "%s\n"
-	     (format (or (and (stringp org-html-xml-declaration)
+   (when (and (not (org-html-html5-p info)) (org-html-xhtml-p info))
+     (let ((decl (or (and (stringp org-html-xml-declaration)
 			      org-html-xml-declaration)
 			 (cdr (assoc (plist-get info :html-extension)
 				     org-html-xml-declaration))
 			 (cdr (assoc "html" org-html-xml-declaration))
 
-			 "")
-		     (or (and org-html-coding-system
-			      (fboundp 'coding-system-get)
-			      (coding-system-get org-html-coding-system 'mime-charset))
-			 "iso-8859-1"))))
+			 "")))
+       (when (not (or (eq nil decl) (string= "" decl)))
+	 (format "%s\n"
+		 (format decl
+		  (or (and org-html-coding-system
+			   (fboundp 'coding-system-get)
+			   (coding-system-get org-html-coding-system 'mime-charset))
+		      "iso-8859-1"))))))
    (let* ((dt (plist-get info :html-doctype))
 	  (dt-cons (assoc dt org-html-doctype-alist)))
      (if dt-cons
-- 
1.8.0


  parent reply	other threads:[~2013-04-30 14:40 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-19  9:57 [PATCH] export to various flavors of (X)HTML Eric Abrahamsen
2013-04-19 15:37 ` Rick Frankel
2013-04-20  2:59   ` Eric Abrahamsen
2013-04-23  1:00     ` Rick Frankel
2013-04-23  4:30       ` Eric Abrahamsen
2013-04-23  4:57         ` Samuel Wales
2013-04-23  6:55           ` Carsten Dominik
2013-04-23  7:54             ` Eric Abrahamsen
2013-04-23 12:09         ` François Pinard
2013-04-24  1:17           ` Christian Wittern
2013-04-24 13:10             ` François Pinard
2013-04-25 21:20               ` Eric Abrahamsen
2013-04-26 13:49                 ` Rick Frankel
2013-04-26 17:14                   ` Eric Abrahamsen
2013-04-26 18:49                     ` Rick Frankel
2013-04-29  6:02                       ` Eric Abrahamsen
2013-04-29  7:45                         ` Nicolas Goaziou
2013-04-30 14:38                         ` Rick Frankel
2013-04-30 14:40                         ` Rick Frankel [this message]
2013-05-01  3:26                           ` Eric Abrahamsen
2013-05-01 11:55                             ` Rick Frankel
2013-05-02 21:07                               ` Eric Abrahamsen
2013-05-03  7:17                                 ` Carsten Dominik
2013-05-06  5:49                                 ` Carsten Dominik
2013-05-06  7:36                                   ` Eric Abrahamsen
2013-05-06  7:48                                     ` Carsten Dominik
2013-05-06  9:05                                       ` Eric Abrahamsen
2013-05-06 12:56                                         ` Rick Frankel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d2cc131cca2180893250bd7c0ff21cf6@mail.rickster.com \
    --to=rick@rickster.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).