diff options
| author | Katsumi Yamaoka | 2017-02-20 06:40:03 +0000 |
|---|---|---|
| committer | Katsumi Yamaoka | 2017-02-20 06:40:03 +0000 |
| commit | b2b31596f807cd593481b75a543b76c9fd76affb (patch) | |
| tree | adc3ab241c9e09cbf4982d957e8c34b1b7a42178 | |
| parent | 851b38bcdfdb1a503f1434f4459af9d1d325f2d0 (diff) | |
| download | emacs-b2b31596f807cd593481b75a543b76c9fd76affb.tar.gz emacs-b2b31596f807cd593481b75a543b76c9fd76affb.zip | |
mm-decode.el: Simplify regexp used to search html meta tag
* lisp/gnus/mm-decode.el (mm-add-meta-html-tag, mm-shr):
Simplify regexp used to search html meta tag.
| -rw-r--r-- | lisp/gnus/mm-decode.el | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/lisp/gnus/mm-decode.el b/lisp/gnus/mm-decode.el index becf6d140b1..5b8aeb3ca31 100644 --- a/lisp/gnus/mm-decode.el +++ b/lisp/gnus/mm-decode.el | |||
| @@ -1414,10 +1414,9 @@ Return t if meta tag is added or replaced." | |||
| 1414 | (goto-char (point-min)) | 1414 | (goto-char (point-min)) |
| 1415 | (if (re-search-forward "\ | 1415 | (if (re-search-forward "\ |
| 1416 | <meta\\s-+http-equiv=[\"']?content-type[\"']?\\s-+content=[\"']?\ | 1416 | <meta\\s-+http-equiv=[\"']?content-type[\"']?\\s-+content=[\"']?\ |
| 1417 | text/\\(\\sw+\\)\\(?:;\\s-*charset=\\([^\t\n\r \"'>]+\\)\\)?[^>]*>" nil t) | 1417 | text/html\\(?:;\\s-*charset=\\([^\t\n\r \"'>]+\\)\\)?[^>]*>" nil t) |
| 1418 | (if (and (not force-charset) | 1418 | (if (and (not force-charset) |
| 1419 | (match-beginning 2) | 1419 | (match-beginning 1)) |
| 1420 | (string-match "\\`html\\'" (match-string 1))) | ||
| 1421 | ;; Don't modify existing meta tag. | 1420 | ;; Don't modify existing meta tag. |
| 1422 | nil | 1421 | nil |
| 1423 | ;; Replace it with the one specifying charset. | 1422 | ;; Replace it with the one specifying charset. |
| @@ -1796,18 +1795,16 @@ If RECURSIVE, search recursively." | |||
| 1796 | charset coding char document) | 1795 | charset coding char document) |
| 1797 | (mm-with-part (or handle (setq handle (mm-dissect-buffer t))) | 1796 | (mm-with-part (or handle (setq handle (mm-dissect-buffer t))) |
| 1798 | (setq case-fold-search t) | 1797 | (setq case-fold-search t) |
| 1799 | (setq charset | 1798 | (or (setq charset |
| 1800 | (or (mail-content-type-get (mm-handle-type handle) 'charset) | 1799 | (mail-content-type-get (mm-handle-type handle) 'charset)) |
| 1801 | (progn | 1800 | (progn |
| 1802 | (goto-char (point-min)) | 1801 | (goto-char (point-min)) |
| 1803 | (and (re-search-forward "\ | 1802 | (and (re-search-forward "\ |
| 1804 | <meta\\s-+http-equiv=[\"']?content-type[\"']?\\s-+content=[\"']?\ | 1803 | <meta\\s-+http-equiv=[\"']?content-type[\"']?\\s-+content=[\"']?\ |
| 1805 | text/\\(\\sw+\\)\\(?:;\\s-*charset=\\([^\t\n\r \"'>]+\\)\\)?[^>]*>" nil t) | 1804 | text/html;\\s-*charset=\\([^\t\n\r \"'>]+\\)[^>]*>" nil t) |
| 1806 | (setq coding | 1805 | (setq coding (mm-charset-to-coding-system (match-string 1) |
| 1807 | (mm-charset-to-coding-system (match-string 2) | 1806 | nil t)))) |
| 1808 | nil t)) | 1807 | (setq charset mail-parse-charset)) |
| 1809 | (string-match "\\`html\\'" (match-string 1)))) | ||
| 1810 | mail-parse-charset)) | ||
| 1811 | (when (and (or coding | 1808 | (when (and (or coding |
| 1812 | (setq coding (mm-charset-to-coding-system charset nil t))) | 1809 | (setq coding (mm-charset-to-coding-system charset nil t))) |
| 1813 | (not (eq coding 'ascii))) | 1810 | (not (eq coding 'ascii))) |