Synch with `t-gnus-6_14' and Gnus.
[elisp/gnus.git-] / lisp / nnshimbun.el
index 3ca4016..be376c6 100644 (file)
      (index-url      . nnshimbun-url)
      (from-address   . "zdnn@softbank.co.jp")
      (make-contents  . nnshimbun-make-html-contents)
-     (contents-start . "<!--BODY-->")
-     (contents-end   . "<!--BODYEND-->"))
+     (contents-start . "\\(<!--BODY-->\\|[0-9]+\e$BG/\e(B[0-9]+\e$B7n\e(B[0-9]+\e$BF|\e(B[^<]*</font></td>[ \t\r\f\n]*</tr>[ \t\r\f\n]*</table>[ \t\r\f\n]*\\(</p>\\)?\\)")
+     (contents-end   . "\\(<!--BODYEND-->\\|<div align=\"right\">\\|<\\(b\\|strong\\)>\\[</\\2>[^<]*<\\2>ZDNet/\\(JAPAN\\|USA\\)\\]\\(<[^>]+>\\)?</\\2>\\)"))
     ("mew"
      (url . "http://www.mew.org/archive/")
      (groups ,@(mapcar #'car nnshimbun-mew-groups))
@@ -748,11 +748,11 @@ is enclosed by at least one regexp grouping construct."
 
 (defun nnshimbun-make-text-or-html-contents (header &optional x-face)
   (let ((case-fold-search t) (html t) (start))
-    (when (and (search-forward nnshimbun-contents-start nil t)
+    (when (and (re-search-forward nnshimbun-contents-start nil t)
               (setq start (point))
-              (search-forward nnshimbun-contents-end nil t))
+              (re-search-forward nnshimbun-contents-end nil t))
+      (delete-region (match-beginning 0) (point-max))
       (delete-region (point-min) start)
-      (delete-region (- (point) (length nnshimbun-contents-end)) (point-max))
       (nnshimbun-shallow-rendering)
       (setq html nil))
     (goto-char (point-min))
@@ -769,11 +769,11 @@ is enclosed by at least one regexp grouping construct."
 
 (defun nnshimbun-make-html-contents (header &optional x-face)
   (let (start)
-    (when (and (search-forward nnshimbun-contents-start nil t)
+    (when (and (re-search-forward nnshimbun-contents-start nil t)
               (setq start (point))
-              (search-forward nnshimbun-contents-end nil t))
-      (delete-region (point-min) start)
-      (delete-region (- (point) (length nnshimbun-contents-end)) (point-max)))
+              (re-search-forward nnshimbun-contents-end nil t))
+      (delete-region (match-beginning 0) (point-max))
+      (delete-region (point-min) start))
     (goto-char (point-min))
     (nnshimbun-insert-header header)
     (insert "Content-Type: text/html; charset=ISO-2022-JP\n"