Browse Source

edit-server-htmlize.el: handle Gmail <div> and <span> tags

It looks like gmail is handling newlines with <div> blocks now. This
relies on the CSS having display: block attributes. Also it occasionally
spews <span> tags into the mix so I've also removed those as well.
Alex Bennée 11 years ago
parent
commit
932cfe1b1d
1 changed files with 4 additions and 2 deletions
  1. 4 2
      edit-server-htmlize.el

+ 4 - 2
edit-server-htmlize.el

@@ -85,9 +85,11 @@ but only turns <br> tags into line breaks."
   (interactive)
   (save-excursion
     (let ((case-fold-search t)
-          (buffer-read-only nil))
+          (buffer-read-only nil)
+	  (edit-server-remove-list (append (list "span") html2text-remove-tag-list)))
       (html2text-replace-string "<br>" "\n" (point-min) (point-max))
-      (html2text-remove-tags html2text-remove-tag-list)
+      (html2text-replace-string "</div>" "</div>\n" (point-min) (point-max))
+      (html2text-remove-tags edit-server-remove-list)
       (html2text-format-tags)
       (html2text-remove-tags html2text-remove-tag-list2)
       (edit-server-html2text-substitute)