summaryrefslogtreecommitdiff
path: root/lisp/net
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2019-05-13 15:04:46 -0400
committerLars Ingebrigtsen <larsi@gnus.org>2019-05-13 15:04:46 -0400
commit648a52ae69a1786774e2e94c69f43f7c1d6f24e0 (patch)
treea07a3f82d70fef9dd69def2b3ef3c514499ad692 /lisp/net
parent81af228a63c6ca284ae9fc1647615842c03d7881 (diff)
downloademacs-648a52ae69a1786774e2e94c69f43f7c1d6f24e0.tar.gz
Fix problems in shr when indenting tables
* lisp/net/shr.el (shr-mark-fill, shr-insert-table): Fix problems when block-quoting/<li>-ing a table -- the indentation/prefix was inserted twice (bug#32277).
Diffstat (limited to 'lisp/net')
-rw-r--r--lisp/net/shr.el6
1 files changed, 4 insertions, 2 deletions
diff --git a/lisp/net/shr.el b/lisp/net/shr.el
index 2f628e1caa2..4820d8b4365 100644
--- a/lisp/net/shr.el
+++ b/lisp/net/shr.el
@@ -1790,7 +1790,8 @@ The preference is a float determined from `shr-prefer-media-type'."
(defun shr-mark-fill (start)
;; We may not have inserted any text to fill.
- (unless (= start (point))
+ (when (and (/= start (point))
+ (not (get-text-property start 'shr-table-id)))
(put-text-property start (1+ start)
'shr-indentation shr-indentation)))
@@ -2087,7 +2088,8 @@ flags that control whether to collect or render objects."
(setq max (max max (nth 2 column))))
max)))
(dotimes (_ (max height 1))
- (shr-indent)
+ (when (bolp)
+ (shr-indent))
(insert shr-table-vertical-line "\n"))
(dolist (column row)
(when (> (nth 2 column) -1)