[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Emacs-W3m bug about highlight .
- From: Katsumi Yamaoka <yamaoka@xxxxxxx>
- Date: Tue, 03 Jun 2008 13:08:09 +0900
- X-ml-name: emacs-w3m
- X-mail-count: 10200
- References: <20080602092740.GA754@xxxxxxxxxxxxxx>
>>>>> In [emacs-w3m : No.10192]
>>>>> Andy Stewart <lazycat.manatee@xxxxxxxxx> wrote:
---------------------> code start <---------------------------
> (setq w3m-use-filter t)
> (defun my-w3m-filter-for-google-cn (&rest args)
> "Replace <font color=CC0033> tags with <b>'s."
> (goto-char (point-min))
> (while (re-search-forward "<font color=CC0033>\\([^<]+\\)</font>" nil t)
> (replace-match "<b>\\1</b>")))
> (eval-after-load "w3m-filter"
> '(add-to-list 'w3m-filter-rules
> '("\\`http://www\\.google\\.cn/"
> my-w3m-filter-for-google-cn)))
--------------------> code end <-------------------------------
> But today, i update Emacs-W3m CVS version (2008-06-02), the Chinese
> keyword (example "中国") can't highlight in the google search pages.
How about replacing the regexp as follows?
(defun my-w3m-filter-for-google-cn (&rest args)
"Replace <font color=\"#cc0033\"> tags with <b>'s."
(goto-char (point-min))
(while (re-search-forward "<font color=\"#cc0033\">\\([^<]+\\)</font>" nil t)
(replace-match "<b>\\1</b>")))