[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] Bug? Setting #+OPTIONS: title:nil Seems to Be Ignored in HTML Ex
From: |
Tim Cross |
Subject: |
Re: [O] Bug? Setting #+OPTIONS: title:nil Seems to Be Ignored in HTML Export. |
Date: |
Wed, 02 Aug 2017 07:58:05 +1000 |
User-agent: |
mu4e 0.9.18; emacs 25.2.1 |
I think I agree. All HTML documents should have a title tag. Not all
HTML documents need a h1-title. I think the easy solution is to just
default to document name when no title is set and don't add a
h1-title. If a title block is set, then do as is now the case.
tim
Rasmus writes:
> Kaushal Modi <address@hidden> writes:
>
>> This patch fixes this:
>>
>> From e57e9e798dd1a54cae7a633fc67e2f825b967eea Mon Sep 17 00:00:00 2001
>> From: Kaushal Modi <address@hidden>
>> 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 <title>
>> tag in HTML export if :with-title property is nil. Example: by
>> setting #+OPTIONS: title:nil
>>
>> Reported by: Ian <address@hidden>
>> ---
>> 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</title>\n" title)
>> + (when (plist-get info :with-title)
>> + (format "<title>%s</title>\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!
> From dace1586373df27863934675967eef8c56747a82 Mon Sep 17 00:00:00 2001
> From: Rasmus <address@hidden>
> 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: address@hidden
> <http://permalink.gmane.org/gmane.emacs.orgmode/114942>
> ---
> 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
--
Tim Cross
- Re: [O] Bug? Setting #+OPTIONS: title:nil Seems to Be Ignored in HTML Export., (continued)
- Re: [O] Bug? Setting #+OPTIONS: title:nil Seems to Be Ignored in HTML Export., Rasmus, 2017/08/01
- Re: [O] Bug? Setting #+OPTIONS: title:nil Seems to Be Ignored in HTML Export., Kaushal Modi, 2017/08/01
- Re: [O] Bug? Setting #+OPTIONS: title:nil Seems to Be Ignored in HTML Export., Rasmus, 2017/08/01
- Re: [O] Bug? Setting #+OPTIONS: title:nil Seems to Be Ignored in HTML Export., Kaushal Modi, 2017/08/01
- Re: [O] Bug? Setting #+OPTIONS: title:nil Seems to Be Ignored in HTML Export., Rasmus, 2017/08/01
- Re: [O] Bug? Setting #+OPTIONS: title:nil Seems to Be Ignored in HTML Export., Kaushal Modi, 2017/08/01
- Re: [O] Bug? Setting #+OPTIONS: title:nil Seems to Be Ignored in HTML Export., Rasmus, 2017/08/09
- Re: [O] Bug? Setting #+OPTIONS: title:nil Seems to Be Ignored in HTML Export., Rasmus, 2017/08/09
- Re: [O] Bug? Setting #+OPTIONS: title:nil Seems to Be Ignored in HTML Export., Kaushal Modi, 2017/08/14
- Re: [O] Bug? Setting #+OPTIONS: title:nil Seems to Be Ignored in HTML Export., Tim Cross, 2017/08/01
Re: [O] Bug? Setting #+OPTIONS: title:nil Seems to Be Ignored in HTML Export.,
Tim Cross <=