summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/net/shr.el9
1 files changed, 8 insertions, 1 deletions
diff --git a/lisp/net/shr.el b/lisp/net/shr.el
index 94d68faf2a8..2f628e1caa2 100644
--- a/lisp/net/shr.el
+++ b/lisp/net/shr.el
@@ -1755,7 +1755,14 @@ The preference is a float determined from `shr-prefer-media-type'."
(defun shr-tag-ol (dom)
(shr-ensure-paragraph)
- (let ((shr-list-mode 1))
+ (let* ((attrs (dom-attributes dom))
+ (start-attr (alist-get 'start attrs))
+ ;; Start at 1 if there is no start attribute
+ ;; or if start can't be parsed as an integer.
+ (start-index (condition-case _
+ (cl-parse-integer start-attr)
+ (t 1)))
+ (shr-list-mode start-index))
(shr-generic dom))
(shr-ensure-paragraph))