From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id WMUXL+e3/V90KgAA0tVLHw (envelope-from ) for ; Tue, 12 Jan 2021 14:53:27 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id 0AH5Kue3/V8ycwAAbx9fmQ (envelope-from ) for ; Tue, 12 Jan 2021 14:53:27 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 979D49401C0 for ; Tue, 12 Jan 2021 14:53:27 +0000 (UTC) Received: from localhost ([::1]:51112 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kzL2y-0004k8-Mm for larch@yhetil.org; Tue, 12 Jan 2021 09:53:24 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:55292) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kzL1l-0004Jo-NQ for emacs-orgmode@gnu.org; Tue, 12 Jan 2021 09:52:09 -0500 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]:40892) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kzL1j-0003JA-Hn for emacs-orgmode@gnu.org; Tue, 12 Jan 2021 09:52:09 -0500 Received: by mail-wm1-x330.google.com with SMTP id r4so2356114wmh.5 for ; Tue, 12 Jan 2021 06:52:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=bjmOlmN4gkHvl4sszEQxlHDGCcSxq/2t1/PAaRzUeA0=; b=fSiAB0pFznfZ7nhyJk1cdMOYaIbhEyWDfvHGUeNmfYogqCvaiLMSZ2rLExONApeXhq EHy3S3/9GbQHIcT+SL6ioDEmG7AH+Yk5qPFzk0X5TBvZogkcdimABcUysK2SVIfbXNWc l7hH7hc/ddVgE5O/zmLIjAPbE9izGoCM0Buis4tDetQvzZTx7J2eOcGGY//e6oGwI4dn j8Q7lVE7YIDEliuaGLLTQ8ZW7oUOCOQS3UThsffcTiT4RzD9Cxb8V3DqJMCnzjUznpX7 OoqBmJ7cdXQSIB+FDt9FfLawJcyzOWSAnLk8SkdhWyvITjwYsM4FIz+ErnxQCW60d/Na lIqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=bjmOlmN4gkHvl4sszEQxlHDGCcSxq/2t1/PAaRzUeA0=; b=ciRgCVcmHxsIKl9gyk1E5v1+2EwJ4vGLpeort0DO4iHAsyXqP5od5CnV3EYA0OUlL7 v8gj34H/lX/0+9IpoF8LQoY37Ee3oZO9LE22H1K0HFYCBCi0EuGb61QSJPob8c/xADOT RqAZBkutymF3X1bwaium6YUuuRNs6ShUb4AYN+WLyzkx6Whs4B67GKkpeWjLvIMYFRaj 4gUHfetLRJtJgweo/fGziC06reC4blfR95G+6R5/sPbZ6dIlhii8H0Q+b1CqgHAr7Eck o0TXtzj7t4Wsm9HT7NhoomeHwgaAYVurj9TWLQ6EE99uLH97Ywn2j0/sxuV6b+bfM2Lj bPzw== X-Gm-Message-State: AOAM532tND8QkbWB2AVDwk7lo0TQM6PIGEVJN6md9ulysmjL0At5p50A qyTcalFEYUYd8M7MGtZx5o9GpIjPAXGUpv10U1bwdIeSI7Vg6Q== X-Google-Smtp-Source: ABdhPJwft2wZnPvELE9Ik7ZTN53qv+lNkbRUNSmGlG0nCFJ3DWXbVJrnF58UzKXhvFQGGqd4FurGRHskh8nR94CnCtU= X-Received: by 2002:a7b:cbd0:: with SMTP id n16mr4014220wmi.162.1610463125465; Tue, 12 Jan 2021 06:52:05 -0800 (PST) MIME-Version: 1.0 References: <874kjndkad.fsf@kyleam.com> In-Reply-To: <874kjndkad.fsf@kyleam.com> From: Tim Visher Date: Tue, 12 Jan 2021 09:51:29 -0500 Message-ID: Subject: Re: ox-html Incorrectly (?) Puts HTML Into the `` Tag To: Kyle Meyer <kyle@kyleam.com> Content-Type: multipart/alternative; boundary="000000000000846da505b8b52aae" Received-SPF: pass client-ip=2a00:1450:4864:20::330; envelope-from=tim.visher@gmail.com; helo=mail-wm1-x330.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." <emacs-orgmode.gnu.org> List-Unsubscribe: <https://lists.gnu.org/mailman/options/emacs-orgmode>, <mailto:emacs-orgmode-request@gnu.org?subject=unsubscribe> List-Archive: <https://lists.gnu.org/archive/html/emacs-orgmode> List-Post: <mailto:emacs-orgmode@gnu.org> List-Help: <mailto:emacs-orgmode-request@gnu.org?subject=help> List-Subscribe: <https://lists.gnu.org/mailman/listinfo/emacs-orgmode>, <mailto:emacs-orgmode-request@gnu.org?subject=subscribe> Cc: Emacs Org Mode mailing list <emacs-orgmode@gnu.org> Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" <emacs-orgmode-bounces+larch=yhetil.org@gnu.org> X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -4.00 Authentication-Results: aspmx1.migadu.com; none X-Migadu-Queue-Id: 979D49401C0 X-Spam-Score: -4.00 X-Migadu-Scanner: scn0.migadu.com X-TUID: S22Zc2TBuOBp --000000000000846da505b8b52aae Content-Type: text/plain; charset="UTF-8" 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 > <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 "‎")) ``` 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? --000000000000846da505b8b52aae Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><div dir=3D"ltr">On Mon, Jan 11, 2021 at 8:19 PM Kyle Meye= r <<a href=3D"mailto:kyle@kyleam.com">kyle@kyleam.com</a>> wrote:<br>= </div><div class=3D"gmail_quote"><blockquote class=3D"gmail_quote" style=3D= "margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-le= ft:1ex">Tim Visher writes:<br> <br> > Hi all,<br> ><br> > I noticed over the weekend that the `<title>` tag in an ox-html = document is<br> > populated with HTML when inline formatting like bold or italics is use= d.<br> [...]<br> > Is this something we'd take a patch for?<br> <br> Thanks for reporting.=C2=A0 Is this addressed by the in-progress series at<= br> <<a href=3D"https://orgmode.org/list/87o8hwpz34.fsf@gmail.com/" rel=3D"n= oreferrer" target=3D"_blank">https://orgmode.org/list/87o8hwpz34.fsf@gmail.= com/</a>>?<br></blockquote><div><br></div><div>IIUC yes. I believe the f= ollowing section of the diff should address it.</div><div><br></div>```<br>= <font face=3D"monospace">+ =C2=A0(let* ((title (org-html-plain-text<br>+ = (org-element-interpret-data (plist-get info :title)) info))<br>+ ;; Set ti= tle to an invisible character instead of leaving it<br>+ ;; empty, which i= s invalid.<br>+ (title (if (org-string-nw-p title) title "&lrm;&q= uot;))</font><br>```<br><div><br></div><div>If I'm reading the code cor= rectly, `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 beli= eve you're right.</div><div><br></div><div>Is that your read as well?</= div></div></div> --000000000000846da505b8b52aae--