From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kaushal Modi Subject: Re: Bug? Setting #+OPTIONS: title:nil Seems to Be Ignored in HTML Export. Date: Mon, 31 Jul 2017 18:33:50 +0000 Message-ID: References: <71359491574f233bd37d0804042fb701@wilkesley.net> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="001a114b28624275e80555a14667" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:54680) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dcFVz-0006vw-JS for emacs-orgmode@gnu.org; Mon, 31 Jul 2017 14:34:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dcFVy-0004HC-CF for emacs-orgmode@gnu.org; Mon, 31 Jul 2017 14:34:03 -0400 Received: from mail-lf0-x233.google.com ([2a00:1450:4010:c07::233]:34639) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dcFVy-0004G2-0i for emacs-orgmode@gnu.org; Mon, 31 Jul 2017 14:34:02 -0400 Received: by mail-lf0-x233.google.com with SMTP id g25so113553450lfh.1 for ; Mon, 31 Jul 2017 11:34:01 -0700 (PDT) In-Reply-To: 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: lists@wilkesley.net, emacs-orgmode@gnu.org --001a114b28624275e80555a14667 Content-Type: text/plain; charset="UTF-8" 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) -- 2.13.0 OK to commit to maint? On Mon, Jul 31, 2017 at 2:24 PM Kaushal Modi wrote: > > C-c C-e h H (html export to buffer) gives: > > ===== > > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> > > > > > > This Title Must Not Export > == == > -- Kaushal Modi --001a114b28624275e80555a14667 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
This patch fixes this:

From e57e9e= 798dd1a54cae7a633fc67e2f825b967eea Mon Sep 17 00:00:00 2001
From:= Kaushal Modi <kaushal.modi@gm= ail.com>
Date: Mon, 31 Jul 2017 14:30:40 -0400
S= ubject: [PATCH] Respect :with-title in ox-html

* l= isp/ox-html.el (org-html--build-meta-info): Do not insert <title>
=C2=A0 tag in HTML export if :with-title property is nil.=C2=A0 Exam= ple: by
=C2=A0 setting #+OPTIONS: title:nil

<= div>Reported by: Ian <lists@wilke= sley.net>
---
=C2=A0lisp/ox-html.el | 3 ++-
=C2=A01 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lisp/ox-html.el b/lisp/ox-html.el
index aeb= 38ebc10..08381d0c19 100644
--- a/lisp/ox-html.el
+++ b/= lisp/ox-html.el
@@ -1812,7 +1812,8 @@ INFO is a plist used as a c= ommunication channel."
=C2=A0 =C2=A0 =C2=A0 =C2=A0 viewport-options ", "))
=C2=A0 =C2=A0 =C2=A0 =C2=A0info)
=C2=A0 =C2=A0 =C2=A0 "= ;\n")))
- =C2=A0 =C2=A0 (format "<title>%s</ti= tle>\n" title)
+ =C2=A0 =C2=A0 (when (plist-get info :wit= h-title)
+ =C2=A0 =C2=A0 =C2=A0 (format "<title>%s<= /title>\n" title))
=C2=A0 =C2=A0 =C2=A0 (org-html-close-t= ag "meta" "name=3D\"generator\" content=3D\"O= rg mode\"" info)
=C2=A0 =C2=A0 =C2=A0 "\n"
=C2=A0 =C2=A0 =C2=A0 (and (org-string-nw-p author)
--=C2= =A0
2.13.0


OK to commit t= o maint?

On Mon, Jul 3= 1, 2017 at 2:24 PM Kaushal Modi <kaushal.modi@gmail.com> wrote:

C-c C-e= h H (html export to buffer) gives:

=3D=3D=3D=3D= =3D
<?xml version=3D"1.0" encoding=3D"u= tf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML = 1.0 Strict//EN"
<html xmlns=3D"http://www.w3.org/1999/xhtm= l" lang=3D"en" xml:lang=3D"en">
&= lt;head>
<!-- 2017-07-31 Mon 14:22 -->
&= lt;meta http-equiv=3D"Content-Type" content=3D"text/html;cha= rset=3Dutf-8" />
<meta name=3D"viewport" con= tent=3D"width=3Ddevice-width, initial-scale=3D1" />
<title>This Title Must Not Export</title>
= =3D=3D <snip> =3D=3D
=
--

Kaushal Modi

--001a114b28624275e80555a14667--