From: Ivan Shmakov <ivan@siamics.net>
To: 19587@debbugs.gnu.org
Subject: bug#19587: shr: produces an extra newline before a block element in <li />
Date: Tue, 13 Jan 2015 18:50:51 +0000 [thread overview]
Message-ID: <87k30qwm44.fsf@violet.siamics.net> (raw)
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
next reply other threads:[~2015-01-13 18:50 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-13 18:50 Ivan Shmakov [this message]
2015-12-25 17:33 ` bug#19587: shr: produces an extra newline before a block element in <li /> Lars Ingebrigtsen
2015-12-26 9:12 ` Ivan Shmakov
2015-12-26 19:17 ` Ivan Shmakov
2016-02-29 7:07 ` Lars Ingebrigtsen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87k30qwm44.fsf@violet.siamics.net \
--to=ivan@siamics.net \
--cc=19587@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).