From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kyle Meyer Subject: Re: ox.html causes w3c xhtml validation Date: Sun, 15 Mar 2020 21:54:49 +0000 Message-ID: <87r1xt8es6.fsf@kyleam.com> References: <871rpt1hod.fsf@alphapapa.net> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:56397) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jDbDn-00064P-MN for emacs-orgmode@gnu.org; Sun, 15 Mar 2020 17:55:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jDbDm-0000Mk-CM for emacs-orgmode@gnu.org; Sun, 15 Mar 2020 17:54:59 -0400 Received: from pb-smtp20.pobox.com ([173.228.157.52]:51528) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jDbDl-0008Mi-KY for emacs-orgmode@gnu.org; Sun, 15 Mar 2020 17:54:58 -0400 In-Reply-To: <871rpt1hod.fsf@alphapapa.net> 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-mx.org@gnu.org Sender: "Emacs-orgmode" To: Adam Porter , emacs-orgmode@gnu.org Cc: Colin Baxter Adam Porter writes: > Colin Baxter writes: > >> In my opinion, if it can't be fixed then the changes should be >> removed. Surely, we cannot have an org-mode that knowingly >> exports/publishes something that causes a validation error! > > Looking at the error message, the fix might be very simple: > > The most common cause of this error is unencoded ampersands in URLs as > described by the WDG in "Ampersands in URLs". Hmm, perhaps it is as simple as encoding the ampersand. That won't work with inline javascript, if I'm understanding correctly the link I gave in my reply. *But*, despite being embedded javascript, the librejs magnet link happens within a comment, so I suppose it really just comes down to how librejs treats it. Poking around in librejs (525e3a5), it seems it is clever and will s/&/&/: // Match by link on first parameter (legacy) if (licenses[key]["Magnet link"] === first.replace("&","&") || licenses[key]["URL"] === first.replace("&","&")) { return [true, `Recognized license: "${licenses[key]['Name']}".`]; Colin, could you try exporting with the change below and see if that resolves your validation issues? It'd also be great if you could check whether librejs is still happy after that change. -- >8 -- diff --git a/lisp/ox-html.el b/lisp/ox-html.el index 9a1dd44b5..5c2b766e9 100644 --- a/lisp/ox-html.el +++ b/lisp/ox-html.el @@ -232,7 +232,7 @@ (defconst org-html-special-string-regexps (defconst org-html-scripts "