[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Links not working
- From: Katsumi Yamaoka <yamaoka@xxxxxxx>
- Date: Mon, 22 Feb 2010 09:12:20 +0900
- X-ml-name: emacs-w3m
- X-mail-count: 11152
- References: <20524da71002201158u27636d76w5d9a4008850052a7@xxxxxxxxxxxxxx>
>>>>> In [emacs-w3m : No.11151] Samuel Wales wrote:
> When I go to
> http://en.wikipedia.org/wiki/Microglia
> and RET on the appropriate link, I get
> No such anchor: Role_in_chronic_neuroinflammation
> but it works in Safari.
Unfortunately w3m doesn't understand such a type of name anchors.
Here's a quick hack that works around the problem:
(defadvice w3m-rendering-half-dump (before redefine-name-anchors activate)
"Redefine name anchors so that w3m can handle."
(goto-char (point-min))
(while (re-search-forward "<span[\t\n ]+\\(?:[^\t\n >]+[\t\n ]+\\)*\
id=\"\\([^\"]+\\)\"[^>]*>\\([^<]+\\)</span>" nil t)
(replace-match "<a name=\"\\1\">\\2</a>")))
This advice replaces <span ... id="FOO_BAR">FOO BAR</span> with
<a name="FOO_BAR">FOO BAR</a> in an html source.