From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stephen Berman Newsgroups: gmane.emacs.bugs Subject: bug#23057: 25.0.92; shr wrongly adds two newlines to div element Date: Fri, 18 Mar 2016 22:10:37 +0100 Message-ID: <87lh5fijaq.fsf@gmx.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1458335551 28779 80.91.229.3 (18 Mar 2016 21:12:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 18 Mar 2016 21:12:31 +0000 (UTC) To: 23057@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Mar 18 22:12:13 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ah1gq-0004gk-P7 for geb-bug-gnu-emacs@m.gmane.org; Fri, 18 Mar 2016 22:12:13 +0100 Original-Received: from localhost ([::1]:46319 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ah1gp-0008Au-VS for geb-bug-gnu-emacs@m.gmane.org; Fri, 18 Mar 2016 17:12:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56073) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ah1gj-0008Aa-VR for bug-gnu-emacs@gnu.org; Fri, 18 Mar 2016 17:12:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ah1gg-0001lT-7c for bug-gnu-emacs@gnu.org; Fri, 18 Mar 2016 17:12:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:55853) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ah1gg-0001lP-4f for bug-gnu-emacs@gnu.org; Fri, 18 Mar 2016 17:12:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ah1gg-0003lY-1O for bug-gnu-emacs@gnu.org; Fri, 18 Mar 2016 17:12: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: Fri, 18 Mar 2016 21:12:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 23057 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.145833546214396 (code B ref -1); Fri, 18 Mar 2016 21:12:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 18 Mar 2016 21:11:02 +0000 Original-Received: from localhost ([127.0.0.1]:52980 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ah1ff-0003jn-9c for submit@debbugs.gnu.org; Fri, 18 Mar 2016 17:11:02 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:36613) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ah1fd-0003ja-Hw for submit@debbugs.gnu.org; Fri, 18 Mar 2016 17:10:57 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ah1fU-0001GT-NC for submit@debbugs.gnu.org; Fri, 18 Mar 2016 17:10:52 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:60459) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ah1fU-0001GP-KC for submit@debbugs.gnu.org; Fri, 18 Mar 2016 17:10:48 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55814) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ah1fQ-0007Vh-VQ for bug-gnu-emacs@gnu.org; Fri, 18 Mar 2016 17:10:48 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ah1fN-0001Dv-As for bug-gnu-emacs@gnu.org; Fri, 18 Mar 2016 17:10:44 -0400 Original-Received: from mout.gmx.net ([212.227.15.15]:54367) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ah1fN-0001Dk-0g for bug-gnu-emacs@gnu.org; Fri, 18 Mar 2016 17:10:41 -0400 Original-Received: from rosalinde ([89.245.111.176]) by mail.gmx.com (mrgmx003) with ESMTPSA (Nemesis) id 0MX1dc-1aJpxR4AMO-00W0Ye for ; Fri, 18 Mar 2016 22:10:38 +0100 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.92 (gnu/linux) X-Provags-ID: V03:K0:YcuTeeJ2dbnESP61sTqj+uSGL7YNdY0ITarQZHDz41oxts4v34W 1uhjnp6JlPvh9lTN9SjdFrKRo9vMYAJOBI1iVIpZqwgiCVx3veNH2eTGIt/XoujwKOzdYgJ kvR71h+xDOvDuU+zlhX5yeLMCc+14lXQR6Q8VkBOc2vlBqLJ9+kaP5IUCA0cCKkz7XgdT7g z8fdxjgVr262wceBvroEg== X-UI-Out-Filterresults: notjunk:1;V01:K0:AlLqVXwpxqg=:uVmW1+JYdKLtwxP1OrLuwm M1gNfs2nYicVuMn7qGrPXHECo1muSkLVQK7E/65GuZvD8knPslDOu1IW43hJmrPwlN/qhcN8q rjWsjFKVyW4WW9jNRmd05nN8tz0NNxxTdsdUMcvFXJJO32JECBMoAwEwvGWqPlH8fgRi7Ieug 8t/ZRBtW2dbIC1Ec5tZlgO7ipCLWpYcKMSkkbhnFTHWbuJM4DxknecCEYnNcaKAW1vL1G1OO9 kzKYfD/AUj5LmD1zVhJgEeWWe2OAq9MbSM6BItHQm9RwHWBhCykirb3B0pOo0gTT14zr9zXL9 CcD1n8HqqoVqCIREk9YAoF6TTqTea3MHZw2r9+62JaxzZw7fmwW4dB85Z6Y2euytgJrQv6R0b 0Mu5FeJeIC4zIKI+2QaJA7C9b2bQZbRKvBAsVkd42tsuvOq5IlLX+WL+h41iuSjjGQMrnrwag piX6xT2xOudqRwgV+iOl9+TGqm+wi8wQOT0kdgwd7GMgtKj+opnItFCVrisNGqmeM2qacqFA6 a4d10+gbXbh5vLl3ypODB04r/jJvmQEnbv2TcG/m75pVSekwx1yAvSsZTqt8GjBIxIdzmwfyT zpd5psyzHSNx5tbG724V34AfTCoK8yZLEiKAU2kAh4Ie6bFeaegOj3K1RnihuDGrIxNJMopoq n7Th6hXpDLr7ecaNbG3+aKxpoPO72VUxuntVVkIYtALsdKjphgTFKSWGqRRBj7RWvoGf1aV+A 4r/17thEC6O9V4k5S5PCV5t5fhvAAGOwjXQrq4IYkYqCVzlAaKIzjfrEKqjX/4gOLloZpLjh X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:115055 Archived-At: As a consequence of commit 9781dc4da35934839bf848b576829786962655b4 Author: Lars Ingebrigtsen Date: Mon Feb 29 18:06:36 2016 +1100 Make
in
  • not insert extra newlines * lisp/net/shr.el (shr-tag-div): Make
    in
  • not insert extra newlines (bug#19587). div elements that do not contain other block elements now get two newlines added to them. To reproduce, select the following bit of HTML and apply shr-render-region to it:
    • This is the first paragraph of a list item.

      This is the second paragraph of a list item.

    • This is the first paragraph of a list item.
      This is the second paragraph of a list item.
    This shows up e.g. in Gnus postings displayed as HTML (see http://lists.gnu.org/archive/html/bug-gnu-emacs/2016-03/msg00817.html) and in eww (look e.g. at this page in eww: http://git.savannah.gnu.org/cgit/emacs.git/commit/?h=emacs-25&id=9781dc4da35934839bf848b576829786962655b4). The following patch fixes this display problem for me, but I'm not familiar enough either with shr or with all the details of HTML block elements to be sure this is a sufficient or even correct fix. diff --git a/lisp/net/shr.el b/lisp/net/shr.el index e943132..d9dcda3 100644 --- a/lisp/net/shr.el +++ b/lisp/net/shr.el @@ -812,6 +812,9 @@ shr-ensure-paragraph (line-end-position)) (line-end-position))))) (delete-region (match-beginning 0) (match-end 0))) + ((eq (dom-tag dom) 'div) + ;;
    contains no block element; do nothing. + ) (t (insert "\n\n")))))) In GNU Emacs 25.0.92.4 (x86_64-suse-linux-gnu, GTK+ Version 3.14.15) of 2016-03-18 built on rosalinde Repository revision: ed909c049e845a22a7beb626ac98f139388005fa Windowing system distributor 'The X.Org Foundation', version 11.0.11601000 System Description: openSUSE 13.2 (Harlequin) (x86_64) Configured using: 'configure --with-xwidgets 'CFLAGS=-Og -g3'' Configured features: XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND DBUS GCONF GSETTINGS NOTIFY GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XWIDGETS Important settings: value of $LANG: en_US.UTF-8 value of $XMODIFIERS: @im=ibus locale-coding-system: utf-8-unix