From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rasmus Subject: Re: Bug? Setting #+OPTIONS: title:nil Seems to Be Ignored in HTML Export. Date: Tue, 01 Aug 2017 11:51:16 +0200 Message-ID: <87ini7d3aj.fsf@gmx.us> References: <71359491574f233bd37d0804042fb701@wilkesley.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:43059) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dcTpw-0000r4-BU for emacs-orgmode@gnu.org; Tue, 01 Aug 2017 05:51:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dcTpt-0004xd-Ox for emacs-orgmode@gnu.org; Tue, 01 Aug 2017 05:51:36 -0400 Received: from [195.159.176.226] (port=34649 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dcTpt-0004wh-HF for emacs-orgmode@gnu.org; Tue, 01 Aug 2017 05:51:33 -0400 Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1dcTpk-0003Ky-BI for emacs-orgmode@gnu.org; Tue, 01 Aug 2017 11:51:24 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Kaushal Modi writes: > This patch fixes this: > > From e57e9e798dd1a54cae7a633fc67e2f825b967eea Mon Sep 17 00:00:00 2001 > From: Kaushal Modi > Date: Mon, 31 Jul 2017 14:30:40 -0400 > Subject: [PATCH] Respect :with-title in ox-html > > * lisp/ox-html.el (org-html--build-meta-info): Do not insert > tag in HTML export if :with-title property is nil. Example: by > setting #+OPTIONS: title:nil > > Reported by: Ian <lists@wilkesley.net> > --- > lisp/ox-html.el | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/lisp/ox-html.el b/lisp/ox-html.el > index aeb38ebc10..08381d0c19 100644 > --- a/lisp/ox-html.el > +++ b/lisp/ox-html.el > @@ -1812,7 +1812,8 @@ INFO is a plist used as a communication channel." > viewport-options ", ")) > info) > "\n"))) > - (format "<title>%s\n" title) > + (when (plist-get info :with-title) > + (format "%s\n" title)) > (org-html-close-tag "meta" "name=\"generator\" content=\"Org mode\"" > info) > "\n" > (and (org-string-nw-p author) That is wrong IMO. Title is mandatory in at least HTML{4,5}. https://www.w3schools.com/tags/tag_title.asp AFAIR Org already allows invalid HTML document to be produced when the TITLE is empty, as it’s translated into an empty quote. The right approach IMO is not printing the h1-title block, as in the attached patch. (In general generating the title block should be moved to something like ‘org-html-preamble-format’, though it probably shouldn’t depend on the language of the document...) Rasmus -- Er du tosset for noge' lårt! --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-ox-html-Respect-the-title-option.patch >From dace1586373df27863934675967eef8c56747a82 Mon Sep 17 00:00:00 2001 From: Rasmus Date: Tue, 1 Aug 2017 11:32:44 +0200 Subject: [PATCH] ox-html: Respect the "title" option * lisp/ox-html.el (org-html-template): Respect :with-title. Reported-by: lists@wilkesley.net --- lisp/ox-html.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/ox-html.el b/lisp/ox-html.el index 06dee3af6..43e4ef8d4 100644 --- a/lisp/ox-html.el +++ b/lisp/ox-html.el @@ -2068,7 +2068,8 @@ holding export options." (format "<%s id=\"%s\">\n" (nth 1 div) (nth 2 div))) ;; Document title. (when (plist-get info :with-title) - (let ((title (plist-get info :title)) + (let ((title (and (plist-get info :with-title) + (plist-get info :title))) (subtitle (plist-get info :subtitle)) (html5-fancy (org-html--html5-fancy-p info))) (when title -- 2.13.3 --=-=-=--