bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#19587: shr: produces an extra newline before a block element in <li


From: Ivan Shmakov
Subject: bug#19587: shr: produces an extra newline before a block element in <li />
Date: Tue, 13 Jan 2015 18:50:51 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Package:  emacs
Severity: minor

        As of ec7605b4b137 (2015-01-10 16:54:24 +0000), shr produces an
        extra newline before a “block” element which is the first child
        to a <li /> element.  Consider, e. g.:

(with-temp-buffer
  (let ((r
         (shr-tag-ul
          '(ul nil
               (li nil (div nil "One item."))
               (li nil (div nil "Another item."))))))
    (cons r (buffer-string))))
(nil . "\
• 
  One item.
• 
  Another item.\n\n")

        There, I’d rather expect no newline between the bullet and the
        div elements’ contents, like:

(nil . "\
• One item.
• Another item.\n\n")

        Somewhat surprisingly, this produces a still less consistent
        result when the p elements are used:

(with-temp-buffer
  (let ((r
         (shr-tag-ul
          '(ul nil
               (li nil (p nil "One item."))
               (li nil (p nil "Another item."))
               (li nil
                   (p nil "One more item.")
                   (p nil "And one more paragraph to the same item."))))))
    (cons r (buffer-string))))
(nil . "\
* 
  One item.

*   Another item.

*   One more item.

  And one more paragraph to the same item.\n\n")

        I’d rather expect it to be formatted as follows:

(nil . "\
* One item.

* Another item.

* One more item.

  And one more paragraph to the same item.\n\n")

-- 
FSF associate member #7257  http://boycottsystemd.org/  … 3013 B6A0 230E 334A





reply via email to

[Prev in Thread] Current Thread [Next in Thread]