Lars Ingebrigtsen writes: > The patch is a bit hard to read, because it seems to have a lot of > unrelated changes like: > >> -(require 'shr) >> -(require 'url) >> -(require 'url-queue) >> -(require 'thingatpt) >> (require 'mm-url) >> (require 'puny) >> -(eval-when-compile (require 'subr-x)) ;; for string-trim >> +(require 'shr) >> +(require 'text-property-search) >> +(require 'thingatpt) >> +(require 'url) >> +(require 'url-queue) >> +(eval-when-compile (require 'subr-x)) This is just adding (require 'text-property-search) and removing a stale comment. The only unrelated change is the lexicographic reordering. > and > >> - (when (and shr-target-id >> - (equal (dom-attr dom 'name) shr-target-id)) >> - ;; We have a zero-length element, so just >> - ;; insert... something. >> + (when-let* ((id (or (dom-attr dom 'id) >> + ;; Obsolete since HTML5. >> + (dom-attr dom 'name)))) >> + ;; We have an empty element, so just insert... something. This is not an unrelated change; I'm changing the condition from: (and shr-target-id (equal (dom-attr dom 'name) shr-target-id)) to: (or (dom-attr dom 'id) (dom-attr dom 'name)) and storing the result of the condition for later reuse. The key thing to note is that the 'name' attribute is obsolete in HTML5 and the 'id' attribute is recommended instead, which is why I'm checking both. Though, now that I think about it again, we could avoid checking the 'id' attribute in both shr-tag-a and shr-descend by instead writing: (when-let* ((id (unless (dom-attr dom 'id) ; Handled by `shr-descend'. (dom-attr dom 'name)))) ; Obsolete since HTML5. > and > >> - (insert "*")) >> - (put-text-property start (1+ start) 'shr-target-id shr-target-id)) >> + (insert ?*) >> + (put-text-property (1- (point)) (point) 'display "")) >> + (put-text-property start (1+ start) 'shr-target-id id)) > > so I can't really make out what the changes you're making in this area is... Sorry, I didn't imagine a patch touching 20-odd lines would be problematic. Here's the updated patch in as minimal a form as possible: