Function: shr--set-target-ids

shr--set-target-ids is a byte-compiled function defined in shr.el.gz.

Signature

(shr--set-target-ids IDS)

Source Code

;; Defined in /usr/src/emacs/lisp/net/shr.el.gz
(defun shr--set-target-ids (ids)
  ;; If the buffer is empty, there's no point in setting targets.
  (unless (zerop (- (point-max) (point-min)))
    ;; We may have several targets in the same place (if you have
    ;; several <span id='foo'> things after one another).  So group
    ;; them by position.
    (dolist (group (seq-group-by #'cdr ids))
      (let ((point (min (1- (point-max)) (car group))))
        (put-text-property point (1+ point)
                           'shr-target-id
                           (mapcar #'car (cdr group)))))))