[Top][All Lists]

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

[Emacs-diffs] master b1943e8: Make shr support inline <div>s

From: Lars Ingebrigtsen
Subject: [Emacs-diffs] master b1943e8: Make shr support inline <div>s
Date: Fri, 13 Apr 2018 11:31:57 -0400 (EDT)

branch: master
commit b1943e84bc652e05f0737d1f171a5255b4d96f72
Author: Lars Ingebrigtsen <address@hidden>
Commit: Lars Ingebrigtsen <address@hidden>

    Make shr support inline <div>s
    * lisp/net/shr.el (shr-tag-div): Support display: inline; for
    <div>, since that's a very common thing (bug#25588).
 lisp/net/shr.el | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/lisp/net/shr.el b/lisp/net/shr.el
index aa62e72..7b8c841 100644
--- a/lisp/net/shr.el
+++ b/lisp/net/shr.el
@@ -1368,9 +1368,13 @@ ones, in case fg and bg are nil."
 (defun shr-tag-div (dom)
-  (shr-ensure-newline)
-  (shr-generic dom)
-  (shr-ensure-newline))
+  (let ((display (cdr (assq 'display shr-stylesheet))))
+    (if (or (equal display "inline")
+            (equal display "inline-block"))
+        (shr-generic dom)
+      (shr-ensure-newline)
+      (shr-generic dom)
+      (shr-ensure-newline))))
 (defun shr-tag-s (dom)
   (shr-fontize-dom dom 'shr-strike-through))

reply via email to

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