]> code.delx.au - gnu-emacs/blobdiff - lisp/net/shr.el
Render empty <ul><li><ul> correctly
[gnu-emacs] / lisp / net / shr.el
index 07fcbebce087c133fd8c2cbaf2fb255ad7c98444..2c8ff79763f3cc36219d49f864cb0bac17f1c53c 100644 (file)
@@ -1480,6 +1480,10 @@ The preference is a float determined from `shr-prefer-media-type'."
   (shr-ensure-paragraph)
   (let ((shr-list-mode 'ul))
     (shr-generic dom))
+  ;; If we end on an empty <li>, then make sure we really end on a new
+  ;; paragraph.
+  (unless (bolp)
+    (insert "\n"))
   (shr-ensure-paragraph))
 
 (defun shr-tag-ol (dom)