X-Git-Url: http://cgit.sxemacs.org/?a=blobdiff_plain;f=lisp%2Fhtml2text.el;h=8cfd9b9f903f413bfe212eafbe851b8a368f2811;hb=f91b61597375d95fae71c558c67f3ec7e1f515eb;hp=d21dd2f47958606796a2371ec99b1fd41dbd02da;hpb=88984cdabf005cd880c854e457c1cefc90277e20;p=gnus diff --git a/lisp/html2text.el b/lisp/html2text.el index d21dd2f47..8cfd9b9f9 100644 --- a/lisp/html2text.el +++ b/lisp/html2text.el @@ -1,6 +1,6 @@ ;;; html2text.el --- a simple html to plain text converter -;; Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +;; Copyright (C) 2002-2011 Free Software Foundation, Inc. ;; Author: Joakim Hove @@ -193,7 +193,7 @@ formatting, and then moved afterward.") ;; size=3 ((string-match "[^ ]=[^ ]" prev) (let ((attr (nth 0 (split-string prev "="))) - (value (nth 1 (split-string prev "=")))) + (value (substring prev (1+ (string-match "=" prev))))) (setq attr-list (cons (list attr value) attr-list)))) ;; size= 3 ((string-match "[^ ]=\\'" prev) @@ -204,7 +204,7 @@ formatting, and then moved afterward.") ;; size=3 ((string-match "[^ ]=[^ ]" this) (let ((attr (nth 0 (split-string this "="))) - (value (nth 1 (split-string this "=")))) + (value (substring prev (1+ (string-match "=" this))))) (setq attr-list (cons (list attr value) attr-list)))) ;; size =3 ((string-match "\\`=[^ ]" this) @@ -358,7 +358,8 @@ formatting, and then moved afterward.") (delete-region p1 p4) (when href (goto-char p1) - (insert (substring href 1 -1 )) + (insert (if (string-match "\\`['\"].*['\"]\\'" href) + (substring href 1 -1) href)) (put-text-property p1 (point) 'face 'bold)))) ;; @@ -508,5 +509,5 @@ See the documentation for that variable." ;; ;; (provide 'html2text) -;; arch-tag: e9e57b79-35d4-4de1-a647-e7e01fe56d1e + ;;; html2text.el ends here