]> git.eshelyaron.com Git - emacs.git/commitdiff
Further empty <li> tweaks
authorLars Magne Ingebrigtsen <larsi@gnus.org>
Sun, 20 Mar 2016 14:15:32 +0000 (15:15 +0100)
committerLars Magne Ingebrigtsen <larsi@gnus.org>
Sun, 20 Mar 2016 14:15:32 +0000 (15:15 +0100)
* lisp/net/shr.el (shr-tag-li): When showing several empty
<li> elements, ensure that they really get inserted on a new line.

lisp/net/shr.el
test/data/shr/li-empty.html [new file with mode: 0644]
test/data/shr/li-empty.txt [new file with mode: 0644]

index 4adb4a6099c58ef2478b3b3877e8e8d352018c21..60794158024162622b5b98a5f771ed6372830a6e 100644 (file)
@@ -1617,7 +1617,9 @@ The preference is a float determined from `shr-prefer-media-type'."
        (put-text-property start (1+ start)
                           'shr-continuation-indentation shr-indentation)
        (put-text-property start (1+ start) 'shr-prefix-length (length bullet))
-       (shr-generic dom)))))
+       (shr-generic dom))))
+  (unless (bolp)
+    (insert "\n")))
 
 (defun shr-mark-fill (start)
   ;; We may not have inserted any text to fill.
diff --git a/test/data/shr/li-empty.html b/test/data/shr/li-empty.html
new file mode 100644 (file)
index 0000000..05cfee7
--- /dev/null
@@ -0,0 +1 @@
+<ol><li></li><li></li><li></li></ol>
diff --git a/test/data/shr/li-empty.txt b/test/data/shr/li-empty.txt
new file mode 100644 (file)
index 0000000..8320bc0
--- /dev/null
@@ -0,0 +1,3 @@
+1 
+2 
+3