* html2text.el (html2text-clean-anchor): If there is no HREF,
authorShengHuo ZHU <zsh@cs.rochester.edu>
Sat, 23 Feb 2002 23:21:50 +0000 (23:21 +0000)
committerShengHuo ZHU <zsh@cs.rochester.edu>
Sat, 23 Feb 2002 23:21:50 +0000 (23:21 +0000)
insert nothing.

lisp/ChangeLog
lisp/html2text.el

index 7f961cf..a424fce 100644 (file)
@@ -1,5 +1,8 @@
 2002-02-23  ShengHuo ZHU  <zsh@cs.rochester.edu>
 
+       * html2text.el (html2text-clean-anchor): If there is no HREF,
+       insert nothing.
+       
        * mml.el (mml-generate-mime-1): Add cdr.
        From: andre@slamdunknetworks.com
 
index f76cb30..22ae79b 100644 (file)
@@ -375,16 +375,15 @@ formatting, and then moved afterward.")
   )
 
 (defun html2text-clean-anchor (p1 p2 p3 p4)
-  ;; If someone can explain how to make the URL clickable
-  ;; I will surely improve upon this.
+  ;; If someone can explain how to make the URL clickable I will
+  ;; surely improve upon this.
   (let* ((attr-list (html2text-get-attr p1 p2 "a"))
         (href (html2text-attr-value attr-list "href")))
     (kill-region p1 p4)
-    (goto-char p1)
-    (insert (substring href 1 -1 ))
-    (put-text-property p1 (point) 'face 'bold)
-    )
-  )
+    (when href
+      (goto-char p1)
+      (insert (substring href 1 -1 ))
+      (put-text-property p1 (point) 'face 'bold))))
 
 ;;
 ;; </Functions to be called to format a tag-pair>