emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ox-html Incorrectly (?) Puts HTML Into the `<title>` Tag


From: Tim Visher
Subject: Re: ox-html Incorrectly (?) Puts HTML Into the `<title>` Tag
Date: Tue, 12 Jan 2021 09:51:29 -0500

On Mon, Jan 11, 2021 at 8:19 PM Kyle Meyer <kyle@kyleam.com> wrote:
Tim Visher writes:

> Hi all,
>
> I noticed over the weekend that the `<title>` tag in an ox-html document is
> populated with HTML when inline formatting like bold or italics is used.
[...]
> Is this something we'd take a patch for?

Thanks for reporting.  Is this addressed by the in-progress series at
<87o8hwpz34.fsf@gmail.com/" rel="noreferrer" target="_blank">https://orgmode.org/list/87o8hwpz34.fsf@gmail.com/>?

IIUC yes. I believe the following section of the diff should address it.

```
+  (let* ((title (org-html-plain-text
+ (org-element-interpret-data (plist-get info :title)) info))
+ ;; Set title to an invisible character instead of leaving it
+ ;; empty, which is invalid.
+ (title (if (org-string-nw-p title) title "&lrm;"))

```

If I'm reading the code correctly, `org-html-plain-text` is a specialized form of converting org data into a plain text string with no markup. If I have that correct then I believe you're right.

Is that your read as well?

reply via email to

[Prev in Thread] Current Thread [Next in Thread]