emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r115876: * net/shr.el (shr-descend): Don't bug out i


From: Lars Ingebrigtsen
Subject: [Emacs-diffs] trunk r115876: * net/shr.el (shr-descend): Don't bug out if the anchor is empty.
Date: Sun, 05 Jan 2014 09:45:48 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 115876
revision-id: address@hidden
parent: address@hidden
fixes bug: http://debbugs.gnu.org/16285
committer: Lars Magne Ingebrigtsen <address@hidden>
branch nick: trunk
timestamp: Sun 2014-01-05 10:45:45 +0100
message:
  * net/shr.el (shr-descend): Don't bug out if the anchor is empty.
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/net/shr.el                shr.el-20101002102929-yfzewk55rsg0mn93-1
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2014-01-05 09:27:26 +0000
+++ b/lisp/ChangeLog    2014-01-05 09:45:45 +0000
@@ -1,3 +1,8 @@
+2014-01-05  Lars Magne Ingebrigtsen  <address@hidden>
+
+       * net/shr.el (shr-descend): Don't bug out if the anchor is empty
+       (bug#16285).
+
 2014-01-05  Kenjiro NAKAYAMA  <address@hidden>
 
        * net/eww.el (eww):  Support single/double quote for search.

=== modified file 'lisp/net/shr.el'
--- a/lisp/net/shr.el   2014-01-01 07:43:34 +0000
+++ b/lisp/net/shr.el   2014-01-05 09:45:45 +0000
@@ -380,6 +380,10 @@
        (shr-generic (cdr dom)))
       (when (and shr-target-id
                 (equal (cdr (assq :id (cdr dom))) shr-target-id))
+       ;; If the element was empty, we don't have anything to put the
+       ;; anchor on.  So just insert a dummy character.
+       (when (= start (point))
+         (insert "*"))
        (put-text-property start (1+ start) 'shr-target-id shr-target-id))
       ;; If style is set, then this node has set the color.
       (when style


reply via email to

[Prev in Thread] Current Thread [Next in Thread]