Subject: bug#53409: 29.0.50; Shr doesn't put target ids properties at the right places

From: Damien Merenne <[email-masked]>
Date: Fri, 21 Jan 2022 12:20:32 +0100

Download https://docs.python.org/3/library/functools.html locally, open
with emacs -Q and run `shr-render-buffer`. Goto point 21473 and
describe-face:

             position: 21473 of 24383 (88%), column: 61
            character: SPC (displayed as SPC) (codepoint 32, #o40, #x20)
              charset: ascii (ASCII (ISO646 IRV))
code point in charset: 0x20
               script: latin
               syntax:   	which means: whitespace
             category: .:Base, a:ASCII, l:Latin
             to input: type "C-x 8 RET 20" or "C-x 8 RET SPACE"
          buffer code: #x20
            file code: #x20 (encoded by coding system utf-8-unix)
              display: by this font (glyph code):
    ftcrhb:-PfEd-DejaVu Sans-regular-normal-normal-*-30-*-*-*-*-0-iso10646-1 (#x03)
       hardcoded face: nobreak-space

Character code properties: customize what to show
  name: SPACE
  general-category: Zs (Separator, Space)
  decomposition: (32) (' ')

There are text properties here:
  face                 shr-text
  shr-target-id        ("functools.wraps")

The shr-target-id property is off: the `functools.wraps` should be at 21579.

In GNU Emacs 29.0.50 (build 3, x86_64-pc-linux-gnu, GTK+ Version 3.24.30, cairo version 1.16.0)
 of 2022-01-14 built on workstation.lan
Repository revision: bef9fcc999af5ed5524990c86968be9f9c4497ea
Repository branch: master
System Description: Ubuntu 21.10

Configured using:
 'configure --with-native-compilation --with-mailutils --with-gnutls
 --with-modules --with-json --without-gpm --with-file-notification=yes
 --with-xwidgets --without-selinux --with-libsystemd --with-jpeg
 --with-tiff --with-gif --with-png --with-rsvg --with-imagemagick
 --with-pgtk'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ
IMAGEMAGICK JPEG JSON LCMS2 LIBSYSTEMD LIBXML2 MODULES NATIVE_COMP
NOTIFY INOTIFY PDUMPER PGTK PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF
TOOLKIT_SCROLL_BARS XIM XWIDGETS GTK3 ZLIB

Important settings:
  value of $LC_MONETARY: fr_BE.UTF-8
  value of $LC_NUMERIC: fr_BE.UTF-8
  value of $LC_TIME: fr_BE.UTF-8
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Fundamental

Minor modes in effect:
  semantic-minor-modes-format: ((:eval (if (or semantic-highlight-edits-mode semantic-show-unmatched-syntax-mode)  S)))
  bloom-global-minor-mode: t
  magit-wip-after-apply-mode: t
  global-git-commit-mode: t
  magit-auto-revert-mode: t
  global-tree-sitter-mode: t
  dtrt-indent-global-mode: t
  pdf-occur-global-minor-mode: t
  yas-global-mode: t
  yas-minor-mode: t
  smartparens-global-mode: t
  smartparens-mode: t
  marginalia-mode: t
  selectrum-mode: t
  corfu-global-mode: t
  corfu-mode: t
  global-ligature-mode: t
  ligature-mode: t
  envrc-global-mode: t
  envrc-mode: t
  bepo-global-mode: t
  which-key-mode: t
  savehist-mode: t
  global-so-long-mode: t
  shell-dirtrack-mode: t
  override-global-mode: t
  straight-use-package-mode: t
  straight-package-neutering-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
/home/dam/.emacs.d/straight/build/transient/transient hides /usr/local/share/emacs/29.0.50/lisp/transient
/home/dam/.emacs.d/straight/build/jsonrpc/jsonrpc hides /usr/local/share/emacs/29.0.50/lisp/jsonrpc
/home/dam/.emacs.d/straight/build/xref/xref hides /usr/local/share/emacs/29.0.50/lisp/progmodes/xref
/home/dam/.emacs.d/straight/build/flymake/flymake hides /usr/local/share/emacs/29.0.50/lisp/progmodes/flymake
/home/dam/.emacs.d/straight/build/project/project hides /usr/local/share/emacs/29.0.50/lisp/progmodes/project
/home/dam/.emacs.d/straight/build/let-alist/let-alist hides /usr/local/share/emacs/29.0.50/lisp/emacs-lisp/let-alist
/home/dam/.emacs.d/straight/build/eldoc/eldoc hides /usr/local/share/emacs/29.0.50/lisp/emacs-lisp/eldoc

Features:
(shadow sort mail-extr emacsbug sendmail mhtml-mode css-mode
smartparens-html sgml-mode facemenu descr-text pyimport ...)

Memory information:
((conses 16 4585547 128214)
 (symbols 48 83086 1)
 (strings 32 418778 11223)
 (string-bytes 1 17359348)
 (vectors 16 217327)
 (vector-slots 8 5083843 1072449)
 (floats 8 1099 1858)
 (intervals 56 503538 674)
 (buffers 992 1058))