On 12 May 2012, at 22:49, Alex Schuster wrote:
> … 
>> I want to view the html source of a webpage.
>> 
>> When I run `less file.html` the rendered webpage is shown, not the
>> source. It is as if lynx had been invoked, rather than less. 
>> ...
>> How do I disable less from parsing html source, please?
> 
> You can set LESSIGNORE='*.htm*'. This environment variable is used by the
> lesspipe command, which is invoked by less and filters the input file
> before giving it to less itself.

Contrary to my previous email, sent in error, that does NOT work.

Did you check this yourself?

$ LESSOPEN="" less file.html                # works fine
$ LESSIGNORE='*.htm*' less file.html        #does not

I've also tried `export LESSIGNORE='*.htm*'` (for what difference that makes?) 
and tried running the `less` command on a separate line.

What version of less are you using, please? I have =sys-apps/less-444 installed 
here.

As per my previous reply to Canek's suggestion, I now have a working solution. 
LESSOPEN is the keyword that works for me, here. So I only make this reply to 
you now for completeness, as part of the eternal quest for deeper understanding 
and for the benefit of those searching in the future. LESSIGNORE seems even 
more poorly documented than LESSOPEN - I'm afraid I never think to use `info`, 
only `man` in the first instance.

Stroller.




Reply via email to