From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stephen Berman Newsgroups: gmane.emacs.bugs Subject: bug#44348: 28.0.50; eww renders xml processing element as is Date: Sat, 31 Oct 2020 20:47:09 +0100 Message-ID: <87tuuaqite.fsf@gmx.net> References: Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24736"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 44348@debbugs.gnu.org To: Pankaj Jangid Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Oct 31 20:48:09 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kYwrA-0006Ko-ML for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 31 Oct 2020 20:48:08 +0100 Original-Received: from localhost ([::1]:57718 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kYwr9-0002vP-O4 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 31 Oct 2020 15:48:07 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50964) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kYwr4-0002uv-DT for bug-gnu-emacs@gnu.org; Sat, 31 Oct 2020 15:48:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:51280) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kYwr4-0003ZD-48 for bug-gnu-emacs@gnu.org; Sat, 31 Oct 2020 15:48:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kYwr4-0004fZ-31 for bug-gnu-emacs@gnu.org; Sat, 31 Oct 2020 15:48:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stephen Berman Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 31 Oct 2020 19:48:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 44348 X-GNU-PR-Package: emacs Original-Received: via spool by 44348-submit@debbugs.gnu.org id=B44348.160417364417902 (code B ref 44348); Sat, 31 Oct 2020 19:48:02 +0000 Original-Received: (at 44348) by debbugs.gnu.org; 31 Oct 2020 19:47:24 +0000 Original-Received: from localhost ([127.0.0.1]:34593 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kYwqS-0004ef-8U for submit@debbugs.gnu.org; Sat, 31 Oct 2020 15:47:24 -0400 Original-Received: from mout.gmx.net ([212.227.17.20]:59481) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kYwqQ-0004eS-Fv for 44348@debbugs.gnu.org; Sat, 31 Oct 2020 15:47:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1604173635; bh=r7y0HYIfwxluTWhsOZfj5yDpkjLWhT/w+pjUFVss1qM=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=gjc/BXzxvatgPmQrR8av7wtdbqSYay9a05GCPoebb2I2qcaYpwgfSjZS2AuOkffig +UA+6ZOh/WGeiMCefY7sMvoymy3DdZ5tv/ZWxpnzNEa+qSIGcDtkU1SlkVj1B3A6tT PpobW2MnCPjAF0ZK69r6BS8mUHcByUPRfjfprs8k= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from strobe-jhalfs ([188.109.175.240]) by mail.gmx.com (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MC34X-1ke7mo2qMP-00CQ6o; Sat, 31 Oct 2020 20:47:15 +0100 In-Reply-To: (Pankaj Jangid's message of "Sat, 31 Oct 2020 21:17:35 +0530") X-Provags-ID: V03:K1:+1KDy/zlyasakJtHEil9SYtaHAwU+ryt3n1wzxAChDpeElHmfsK YFRmNvFycAMcVAIv4hmBJtsFqUfugSLHYN2lYRL9Sf7E3jjMY09ORhTJTEqRgQe6sKVEArI IeSeCj7LdQxdcnPHFWJ9StVvsrb0G1x1uBeULmAqu5QX0Re6HdED+87vi/MCFPdULCmdgnz aJnb6fGigQdnccIelUSDA== X-UI-Out-Filterresults: notjunk:1;V03:K0:g3JnlwWTxkI=:jHBBn3DQWX72vGGRbdGOpF bh7I7+xGm/dgaS6jnj4nrRYo5WLvY4z4FwyiWsajfzagmP8DRO2YhKYhX0iFkqR1DpEZ2MYsy /RPTAxvskwmuXlZqc2gU2vVF70N1Md5RdGTtrUiYl8cAWFDiAZ2KSl1egpNfNmN3f+2aqXzUy 8pvYfoX3581UR7wx3m5d284+DvfHdj0rjaalDX29UPRHPvI1Xa+8TkXzv0Q28XalSyxMEgKtU 8oASGm6phHjTSH6heAa+EjfhQJOSFN+VSpPvA8WQqGneLdv1SK1jWgDkfqJeWZL2hZUCmlw+B 08DSQBrDju3U2w7q031L9+PIlAoCsSh2KH6TrN1r8eSCEcGcKt+jHjOC/dQnf3uLpU77a4qc5 VbJr9fJ3QdiScoZNgADMWtNmE82+VVsTerWSgebiyO8UpNcRSr+pOpldNHWwNvLodHIyhDyh1 CZ6KMEv0XZ5y0URP9WwSwTM3FKgAixNiFcJk8wg1FmY1HS6a4FUd4RC1roIoafjVIeXO2V9/3 bfwnUyydA2zTX0x0b8WuZXI9YKH6iMsn2cV5FZez4T6zCYSHhz32Czg4OoY8H+06y62STpMbj Yl6OU3yP5EtWP7n6ephDF9WV3V1XmZgc72rOItHCwrnkCv4SujU7O8LFeAt7VpsoEpXwjiGuJ bexJaucY+424arSOPTwd3BQ0i/iQQu3aaacDB5fjoSb+Iv/qLOi3ZaBn/H7A2bnOK7SliI2zq PfR30hPb/6xDJmSg4EkaaKIAJrYpe+BL5RfybWc80cTIlcA5w3AOXH+wqOSDewJzy5IDisFw X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:192303 Archived-At: On Sat, 31 Oct 2020 21:17:35 +0530 Pankaj Jangid = wrote: > I published a webpage using org. The output has this xml element at the > top: > > > > But this is rendered as it is in eww when I fetch it from the hosted > website. > > When I view-source the element there is: > > <?xml version=3D"1.0" encoding=3D"utf-8"?> > > Note that the opening angle bracket is converted to HTML entity type. The simplest fix would seem to be this: diff --git a/lisp/net/eww.el b/lisp/net/eww.el index fd9fe98439..051698d6d6 100644 =2D-- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -420,7 +420,7 @@ eww--preprocess-html (narrow-to-region start end) (goto-char start) (let ((case-fold-search t)) - (while (re-search-forward "<[^0-9a-z!/]" nil t) + (while (re-search-forward "<[^0-9a-z!?/]" nil t) (goto-char (match-beginning 0)) (delete-region (point) (1+ (point))) (insert "<")))))) But if that's too permissive, then a more specific fix is this: diff --git a/lisp/net/eww.el b/lisp/net/eww.el index fd9fe98439..bc795df256 100644 =2D-- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -421,9 +421,11 @@ eww--preprocess-html (goto-char start) (let ((case-fold-search t)) (while (re-search-forward "<[^0-9a-z!/]" nil t) - (goto-char (match-beginning 0)) - (delete-region (point) (1+ (point))) - (insert "<")))))) + (unless (and (looking-back "\\?" (line-beginning-position)) + (looking-at "xml")) + (goto-char (match-beginning 0)) + (delete-region (point) (1+ (point))) + (insert "<"))))))) ;;;###autoload (defalias 'browse-web 'eww) Steve Berman