Subject: bug#17834: 24.3; html2text chokes on !important in attribute

From: [email-masked] (Mark A. Hershberger)
Date: Sun, 22 Jun 2014 14:24:13 -0400

HTML email snipped that caused this:

<a class=3D"link-enhancr-card-urlWrapper link-enha=
ncr-element" style=3D"color: rgb(0, 0, 0) !important; text-decoration: none=
 !important;" contenteditable=3D"false" href=3D"http://gospeltranslations.o=
rg/wiki/Main_Page"
 target=3D"_blank" rel=3D"nofollow" shape=3D"rect"><span class=3D"yiv107322=
5564link-enhancr-element yiv1073225564link-enhancr-card-title" style=3D"mar=
gin: 0px 0px 4px; color: rgb(0, 0, 0); line-height: 21px; overflow: hidden;=
 font-size: 18px; font-weight: normal; display: inline-block; max-height: 4=
3px;">Gospel Translations</span></a>

Full backtrace:

Debugger entered--Lisp error: (args-out-of-range "!important;\"" 16 12)
  html2text-get-attr(1332 1588)
  html2text-clean-anchor(1332 1588 1865 1869)
  html2text-format-tags()
  html2text()
  byte-code("\306.	\205.\307\310\311	#\210\312	\313\"\203.\n	!\210\202.\312	\314\"\203+.\312	\314\"!\210\202.\312	\315\"\203<.\f\312	\315\"!\210\202.\312	\316\"\203I.

In GNU Emacs 24.3.1 (x86_64-pc-linux-gnu, GTK+ Version 3.12.1)
 of 2014-05-14 on trouble, modified by Debian
Windowing system distributor `The X.Org Foundation', version 11.0.11501000
System Description:	Debian GNU/Linux testing (jessie)

Configured using:
 `configure '--build' 'x86_64-linux-gnu' '--build' 'x86_64-linux-gnu'
 '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib'
 '--localstatedir=/var/lib' '--infodir=/usr/share/info'
 '--mandir=/usr/share/man' '--with-pop=yes'
 '--enable-locallisppath=/etc/emacs24:/etc/emacs:/usr/local/share/emacs/24.3/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/24.3/site-lisp:/usr/share/emacs/site-lisp'
 '--with-crt-dir=/usr/lib/x86_64-linux-gnu' '--with-x=yes'
 '--with-x-toolkit=gtk3' '--with-toolkit-scroll-bars'
 'build_alias=x86_64-linux-gnu' 'CFLAGS=-g -O2 -fstack-protector
 --param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wall'
 'LDFLAGS=-Wl,-z,relro' 'CPPFLAGS=-D_FORTIFY_SOURCE=2''

Important settings:
  value of $LC_COLLATE: en_US.UTF-8
  value of $LC_CTYPE: en_US.UTF-8
  value of $LC_MESSAGES: en_US.UTF-8
  value of $LANG: en_US.utf8
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

Major mode: Debugger

Minor modes in effect:
  diff-auto-refine-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  global-auto-revert-mode: t
  ido-everywhere: t
  shell-dirtrack-mode: t
  display-time-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  buffer-read-only: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t
  abbrev-mode: t

Recent input:
u n n n n <backspace> n n C-n C-n C-n C-n C-n C-n C-n 
C-n C-n M-f M-f M-f M-f M-f C-f C-f C-SPC M-f M-f M-f 
M-f M-f M-f M-f M-f M-f M-w <help-echo> <down-mouse-1> 
<mouse-1> n n n n a s <return> <help-echo> <down-mouse-1> 
<mouse-1> <help-echo> n M-< M-< C-x o M-< <prior> <next> 
<next> <next> <down> <down> <down> <down> <down> <down> 
<down> <up> <return> <down-mouse-1> <mouse-1> <down-mouse-1> 
<mouse-movement> <mouse-movement> <drag-mouse-1> M-w 
<down-mouse-1> <mouse-1> n n n n n n n n n n n n n 
n n n n n n n n n n n n SPC n n n a s <return> SPC 
n a s <return> n n n n q n C-x k <return> n C-x o C-x 
o C-x o C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-b 
C-b C-b C-b C-b C-b C-SPC M-b M-b M-b M-b M-b M-b M-w 
<help-echo> <down-mouse-1> <mouse-movement> <mouse-1> 
<return> C-x 0 C-x o C-x 0 <return> . C-x o C-n C-n 
<return> <help-echo> <down-mouse-1> <mouse-1> <return> 
C-x 1 <return> M-x t o g g l e SPC d e <tab> e <tab> 
<return> C-x 0 <return> C-x b <return> q C-x o C-x 
o q q C-x k <return> C-x k <return> C-x 1 <return> 
M-x M-p <return> C-x k <return> C-x 1 <return> C-p 
C-p C-SPC C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n 
M-w <escape> <help-echo> <down-mouse-1> <mouse-1> C-p 
C-p C-p C-p C-p C-p C-SPC C-p C-p C-p C-p M-w <tab> 
<return> C-x C-f C-g C-x o C-x C-g C-x o C-p C-SPC 
C-n C-n C-n C-n C-g C-n C-n C-n C-n C-p C-p C-p C-n 
C-p C-SPC C-p C-p C-p C-p C-p C-a M-w M-x r e p o <tab> 
<tab> r <tab> <return>

Recent messages:
OVERVIEW
CONTENTS...done
Quit
mouse-2, RET: find function's definition
Mark set
mouse-2, RET: find function's definition
Quit
mouse-2, RET: find function's definition [4 times]
Mark set
Making completion list...

Load-path shadows:
/home/mah/.emacs.d/elpa/markdown-mode-1.9/markdown-mode hides ~/.emacs.d/lisp/markdown-mode
/home/mah/.emacs.d/elpa/htmlize-1.39/htmlize hides ~/.emacs.d/lisp/htmlize
/home/mah/.emacs.d/elpa/yaml-mode-0.0.9/yaml-mode hides ~/.emacs.d/lisp/yaml-mode
/home/mah/.emacs.d/elpa/javascript-2.2.1/javascript hides ~/.emacs.d/lisp/javascript
/home/mah/.emacs.d/elpa/lisppaste-1.8/lisppaste hides ~/.emacs.d/lisp/lisppaste
/home/mah/.emacs.d/elpa/php-mode-1.5.0/php-mode hides ~/.emacs.d/lisp/php-mode
/home/mah/.emacs.d/elpa/magit-1.2.0/magit-wip hides /usr/share/emacs/24.3/site-lisp/magit/magit-wip
/home/mah/.emacs.d/elpa/magit-1.2.0/magit hides /usr/share/emacs/24.3/site-lisp/magit/magit
/home/mah/.emacs.d/elpa/magit-1.2.0/magit-blame hides /usr/share/emacs/24.3/site-lisp/magit/magit-blame
/home/mah/.emacs.d/elpa/magit-1.2.0/magit-svn hides /usr/share/emacs/24.3/site-lisp/magit/magit-svn
/home/mah/.emacs.d/elpa/magit-1.2.0/magit-stgit hides /usr/share/emacs/24.3/site-lisp/magit/magit-stgit
/home/mah/.emacs.d/elpa/magit-1.2.0/magit-topgit hides /usr/share/emacs/24.3/site-lisp/magit/magit-topgit
/home/mah/.emacs.d/elpa/magit-1.2.0/magit-bisect hides /usr/share/emacs/24.3/site-lisp/magit/magit-bisect
/home/mah/.emacs.d/elpa/magit-1.2.0/magit-key-mode hides /usr/share/emacs/24.3/site-lisp/magit/magit-key-mode
/home/mah/.emacs.d/elpa/magit-1.2.0/rebase-mode hides /usr/share/emacs/24.3/site-lisp/magit/rebase-mode
/usr/share/emacs24/site-lisp/cmake-data/cmake-mode hides /usr/share/emacs/site-lisp/cmake-mode
/usr/share/emacs/24.3/site-lisp/debian-startup hides /usr/share/emacs/site-lisp/debian-startup
/usr/share/emacs24/site-lisp/flim/md4 hides /usr/share/emacs/24.3/lisp/md4
~/.emacs.d/lisp/iimage hides /usr/share/emacs/24.3/lisp/iimage
/usr/share/emacs24/site-lisp/flim/hex-util hides /usr/share/emacs/24.3/lisp/hex-util
/home/mah/.emacs.d/elpa/json-1.2/json hides /usr/share/emacs/24.3/lisp/json
/usr/share/emacs24/site-lisp/dictionaries-common/ispell hides /usr/share/emacs/24.3/lisp/textmodes/ispell
/usr/share/emacs24/site-lisp/dictionaries-common/flyspell hides /usr/share/emacs/24.3/lisp/textmodes/flyspell
/home/mah/.emacs.d/elpa/css-mode-1.0/css-mode hides /usr/share/emacs/24.3/lisp/textmodes/css-mode
/usr/share/emacs24/site-lisp/flim/sasl hides /usr/share/emacs/24.3/lisp/net/sasl
/usr/share/emacs24/site-lisp/flim/ntlm hides /usr/share/emacs/24.3/lisp/net/ntlm
/usr/share/emacs24/site-lisp/flim/hmac-def hides /usr/share/emacs/24.3/lisp/net/hmac-def
/usr/share/emacs24/site-lisp/flim/hmac-md5 hides /usr/share/emacs/24.3/lisp/net/hmac-md5
/usr/share/emacs24/site-lisp/flim/sasl-cram hides /usr/share/emacs/24.3/lisp/net/sasl-cram
/usr/share/emacs24/site-lisp/flim/sasl-digest hides /usr/share/emacs/24.3/lisp/net/sasl-digest
/usr/share/emacs24/site-lisp/flim/sasl-ntlm hides /usr/share/emacs/24.3/lisp/net/sasl-ntlm
/home/mah/.emacs.d/elpa/ert-0.1/ert hides /usr/share/emacs/24.3/lisp/emacs-lisp/ert

Features:
(shadow emacsbug pp org-element xml timezone parse-time mediawiki
url-cache mm-url url-http url url-proxy url-privacy url-expand
url-methods url-history url-auth url-cookie url-domsuf url-util url-gw
vc-dir ewoc vc-sccs vc-svn vc-cvs vc-rcs tramp-cache log-edit diff-mode
vc-annotate add-log log-view pcvs-util vc vc-dispatcher subword flymake
php-extras thingatpt eldoc php-mode etags cc-langs cc-mode cc-fonts
cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars woman man
vc-git face-remap debug dired-aux sh-script smie executable ffap
url-parse url-vars loccur misearch multi-isearch epa-file gnutls
network-stream starttls tls mailalias qp time-stamp mail-extr sort
gnus-pers nnmail gnus-int gnus-range mail-source multi-term term
disp-table ehelp view mule-util cal-china lunar solar cal-dst cal-bahai
cal-islam cal-hebrew holidays hol-loaddefs cal-iso vc-bzr test-case-mode
fringe-helper cc-defs project-local-variables org-indent org-wl org-w3m
org-vm org-rmail org-mhe org-mew org-irc org-jsinfo org-infojs org-html
org-info org-gnus org-docview org-bibtex bibtex org-bbdb ob-dot paren
help-at-pt grep gnus gnus-ems nnheader wid-edit chess-autoloads
clojure-test-mode-autoloads company-autoloads css-mode-autoloads
dictionary-autoloads elk-test-autoloads epresent-autoloads
eproject-autoloads eproject ert-autoloads etags-select-autoloads
findr-autoloads flycheck-autoloads f-autoloads fringe-helper-autoloads
guess-style-autoloads highlight-80+-autoloads jimb-patch-autoloads
js2-mode-autoloads lisppaste-autoloads magit-find-file-autoloads
magit-gh-pulls-autoloads gh-autoloads logito-autoloads
magit-tramp-autoloads magit-autoloads markdown-mode-autoloads
marmalade-autoloads furl-autoloads multi-web-mode-autoloads
nrepl-autoloads pcache-autoloads php-extras-autoloads info
php-mode-autoloads pkg-info-autoloads epl-autoloads dash-autoloads
project-local-variables-autoloads relax-autoloads javascript-autoloads
json-autoloads s-autoloads sass-mode-autoloads haml-mode-autoloads
finder-inf scpaste-autoloads htmlize-autoloads shellfm-autoloads
ssh-config-mode-autoloads subatomic-enhanced-theme-autoloads
sudoku-autoloads swank-clojure-autoloads clojure-mode-autoloads
slime-repl-autoloads slime-autoloads test-case-mode-autoloads
weblogger-autoloads xml-rpc-autoloads yaml-mode-autoloads
zen-and-art-theme-autoloads package mu4e mu4e-speedbar speedbar sb-image
ezimage dframe mu4e-main mu4e-view epa derived browse-url mu4e-headers
mu4e-compose mu4e-draft mu4e-actions rfc2368 smtpmail sendmail mu4e-mark
mu4e-message html2text mu4e-proc mu4e-utils doc-view jka-compr
image-mode dired mu4e-lists mu4e-about mu4e-vars message cl-macs gv
rfc822 mml mailabbrev mail-utils gmm-utils mailheader hl-line cl
mu4e-meta electric autorevert edmacro kmacro windmove ido cus-start
cus-load appt diary-lib diary-loaddefs org-clock org-exp ob-exp
org-exp-blocks org-agenda org warnings ob-tangle ob-ref ob-lob ob-table
org-footnote org-src ob-comint ob-keys org-pcomplete org-list org-faces
org-entities noutline outline easy-mmode org-version ob-emacs-lisp ob
org-compat org-macs ob-eval org-loaddefs find-func cal-menu calendar
cal-loaddefs remember tramp tramp-compat auth-source eieio byte-opt
bytecomp byte-compile cconv gnus-util tramp-loaddefs shell pcomplete
format-spec advice help-fns cl-lib advice-preload tabify mm-view
mml-smime mml-sec smime password-cache dig mm-decode mm-bodies mm-encode
mailcap mail-parse rfc2231 rfc2047 rfc2045 ietf-drums mm-util mail-prsvr
server time allout quail help-mode easymenu unichars epg epg-config
w3m-load pylint compile comint ansi-color ring 50magit time-date tooltip
ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd
fontset image regexp-opt fringe tabulated-list newcomment lisp-mode
register page menu-bar rfn-eshadow timer select scroll-bar mouse
jit-lock font-lock syntax facemenu font-core frame cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev
minibuffer loaddefs button faces cus-face macroexp files text-properties
overlay sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote make-network-process dbusbind
dynamic-setting system-font-setting font-render-setting move-toolbar gtk
x-toolkit x multi-tty emacs)