[Date Prev][Date Next][Thread Prev][][Date Index][Thread Index]

Re: Links not working



>>>>> 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.