From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id yDcUAFlQWV9mUQAA0tVLHw (envelope-from ) for ; Wed, 09 Sep 2020 21:59:53 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id 8HmkN1hQWV+2WQAA1q6Kng (envelope-from ) for ; Wed, 09 Sep 2020 21:59:52 +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 4D3BC9403C8 for ; Wed, 9 Sep 2020 21:59:52 +0000 (UTC) Received: from localhost ([::1]:52674 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kG7jK-0005Do-Pj for larch@yhetil.org; Wed, 09 Sep 2020 17:34:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39190) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kG7j7-0005CT-U0 for guix-devel@gnu.org; Wed, 09 Sep 2020 17:34:01 -0400 Received: from sender4-of-o51.zoho.com ([136.143.188.51]:21128) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kG7j4-000479-Jx for guix-devel@gnu.org; Wed, 09 Sep 2020 17:34:01 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1599687235; cv=none; d=zohomail.com; s=zohoarc; b=jCZiHx7OmUl7I2OlxSvaeEZNmHLQy58LML9UQV6EQzPWp5jzwvlVZI+0eiW6nKakrwcv2KOfg/dSAEbiklvFj5J/qlheaLMHtAcj1GIMau3i3oJxWdF5v/TZ2SiMnssi6GSARcNtps6Lrmbh6U+n2WkUXVNmIradTMUDbz2htJQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599687235; h=Content-Type:Date:From:MIME-Version:Message-ID:Subject:To; bh=b0N+Ac8WVninaDSIEIgjFkHR6UX1cSWQaqum7kowGgQ=; b=CogAcrTY/mUqZYP4/xmdFZb8bf/FqgpKDDAjWoV8Y8jpy3pYSxIzigRrx1TeZ/iT2WO771sgDWUal6No+hAz6+wBHJ3ZxL2027WrGeXRBdF11s8EQM/OjyMIbUxGqXq+A8iIqSx44nUqCO+7tT4MpV5m95sn72RqE0zhOnQZCKk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=elephly.net; spf=pass smtp.mailfrom=rekado@elephly.net; dmarc=pass header.from= header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1599687235; s=zoho; d=elephly.net; i=rekado@elephly.net; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; bh=b0N+Ac8WVninaDSIEIgjFkHR6UX1cSWQaqum7kowGgQ=; b=WNQ6XHjJGMEeCbSzxdmNvrBMR2VvHCVZxO17zGMdAF7BbjzoCPseYqS6FA9nYF8g TxcapJX75jGrEZSwhxSXbK4ROuqPFkktLOx8drLNKjTDtH0ZX4D3Fa0bTldyR61DyKq 87z2vJH72ufX/904Elm3s8pWxgBd/iSR7GKlI+dc= Received: from localhost (p54ad4cd7.dip0.t-ipconnect.de [84.173.76.215]) by mx.zohomail.com with SMTPS id 1599687233635426.3281345990122; Wed, 9 Sep 2020 14:33:53 -0700 (PDT) User-agent: mu4e 1.4.13; emacs 27.1 From: Ricardo Wurmus To: guix-devel@gnu.org Subject: [website]: Fix rendering of entities. X-URL: https://elephly.net X-PGP-Key: https://elephly.net/rekado.pubkey X-PGP-Fingerprint: BCA6 89B6 3655 3801 C3C6 2150 197A 5888 235F ACAC Date: Wed, 09 Sep 2020 23:35:06 +0200 Message-ID: <87mu1y63cl.fsf@elephly.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-ZohoMailClient: External X-Zoho-Virus-Status: 1 Received-SPF: pass client-ip=136.143.188.51; envelope-from=rekado@elephly.net; helo=sender4-of-o51.zoho.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/09 16:01:24 X-ACL-Warn: Detected OS = Linux 3.11 and newer [fuzzy] 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, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=elephly.net header.s=zoho header.b=WNQ6XHjJ; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Spam-Score: -2.21 X-TUID: TpLXQxhPOMQZ --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi Guix, this page looks wrong: https://guix.gnu.org/packages/mpc-1.1.0/ The non-breaking space is rendered as =E2=80=9CGNU<*ENTITY*>nbspMPC=E2=80= =9D. The attached patch processes the SHTML to remove *ENTITY* nodes, replacing the =E2=80=9Cnbsp=E2=80=9D entity with an actual non-breaking space; other = entities are silently converted to a single space. --=20 Ricardo --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: inline; filename=0001-website-Render-non-breaking-space-correctly.patch Content-Transfer-Encoding: quoted-printable >From 7745f78abe8ba03cfc3de7655b7c5d766f5ad5b6 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Wed, 9 Sep 2020 23:32:28 +0200 Subject: [PATCH] website: Render non-breaking space correctly. * website/apps/packages/utils.scm (texinfo->shtml): Replace *ENTITY* node with a non-breaking space for the nbsp entity, or a space in case of unknown entities. --- website/apps/packages/utils.scm | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/website/apps/packages/utils.scm b/website/apps/packages/utils.= scm index fb9d3cf..f13bec7 100644 --- a/website/apps/packages/utils.scm +++ b/website/apps/packages/utils.scm @@ -1,6 +1,7 @@ ;;; GNU Guix web site ;;; Copyright =C2=A9 2017 Ludovic Court=C3=A8s ;;; Copyright =C2=A9 2017 Eric Bavier +;;; Copyright =C2=A9 2020 Ricardo Wurmus ;;; ;;; Initially written by sirgazil ;;; who waives all copyright interest on this file. @@ -32,6 +33,7 @@ #:use-module (guix download) #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) + #:use-module (sxml transform) #:use-module (texinfo) #:use-module (texinfo html) #:use-module (ice-9 match) @@ -74,7 +76,17 @@ ;; 'texi-fragment->stexi' uses 'call-with-input-string', so make sure ;; those string ports are Unicode-capable. (with-fluids ((%default-port-encoding "UTF-8")) - (stexi->shtml (texi-fragment->stexi texi)))) + (let ((shtml (stexi->shtml (texi-fragment->stexi texi)))) + (pre-post-order shtml + `((*ENTITY* + . ,(lambda (tag entity) + (match entity + ("nbsp" (string #\xa0)) + (_ " ")))) + (*default* + . ,(lambda args args)) + (*text* + . ,(lambda (_ txt) txt))))))) =20 (define (package-description-shtml package) "Return a SXML representation of PACKAGE description field with HTML --=20 2.28.0 --=-=-=--