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

Re: improper indentation in w3m upon <a>



>>>>> "KY" == Katsumi Yamaoka <yamaoka@xxxxxxx> writes:

KY> Hm, I don't know why, but I confirmed w3m renders at least
KY>     <a href="z"></a>
KY> as: <a href="z"> </a>
More like ...>&nbsp;< actually.

>> Actually I use that trick often, like in http://jidanni.org/makefile
>> target:%_en.html

KY> I see.  Could you test this hook with such html contents?

KY> --8<---------------cut here---------------start------------->8---
KY> (defun my-w3m-remove-hidden-anchors ()
KY>   "Remove hidden anchors like \"<a href=url></a>\" in the current buffer."
KY>   (goto-char (point-min))
KY>   (let ((case-fold-search t))
KY>     (while (re-search-forward "<a[\t\n ]+[^>]+>[\t\n ]*</a>" nil t)
KY>       (delete-region (match-beginning 0) (match-end 0)))))

KY> (add-hook 'w3m-fontify-before-hook 'my-w3m-remove-hidden-anchors)
KY> --8<---------------cut here---------------end--------------->8---

KY> If it is ok, I'll embed the identical thing into emacs-w3m.
Works fine, but isn't it just a workaround for something that should
be fixed in w3m itself? OK, never mind, as w3m-view-source still shows
the original, so the rest is your guys internal affairs. OK, thanks. Bye.