[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to get the inner html of a href link.
- From: Katsumi Yamaoka <yamaoka@xxxxxxx>
- Date: Mon, 16 Mar 2009 14:55:04 +0900
- X-ml-name: emacs-w3m
- X-mail-count: 10772
- References: <87ocw9mrfa.fsf@xxxxxxxxxxxxxx> <b4mwsaw4zuv.fsf@xxxxxxx> <87r614taw6.fsf@xxxxxxxxxxxxxx> <b4mk56vptrg.fsf@xxxxxxx> <878wn8omuh.fsf@xxxxxxxxxxxxxx>
>>>>> In [emacs-w3m : No.10770] netawater wrote:
>> (with-temp-buffer
>> (insert "<a href=\"http://www.example.com\"\
>> fOo=\"FoO-vAlUe\"\
>> BaR=\"bAr-VaLuE\">\n")
>> (goto-char 2)
>> (w3m-parse-attributes (foo (bar :case-ignore))
>> (list foo bar)))
>> => ("FoO-vAlUe" "bar-value")
>>
>> The point has to be within the tag, and only attributes that follow
>> the point will be extracted.
> Thank you for your reply but I tried run these function, it returns
> (nil nil). I use GNU emacs 22.2.1 and w3m-0.5.2.
I guess you've set the default value of `case-fold-search'
variable to nil intentionally. Supposing it's right, I think
setting it to nil is not a good idea, since programmers likely
assume that it remains the default, i.e. t, or easily forget to
bind it to t locally. This should work:
(with-temp-buffer
(insert "<a href=\"http://www.example.com\"\
fOo=\"FoO-vAlUe\"\
BaR=\"bAr-VaLuE\">\n")
(goto-char 2)
(let ((case-fold-search t))
(w3m-parse-attributes (foo (bar :case-ignore))
(list foo bar))))