[elinks-users] Trying to get hooks.pl working

Witold Filipczyk gglater62 at gmail.com
Tue Aug 6 10:43:25 PDT 2013


W dniu 06.08.2013 o 17:12 John Magolske <listmail at b79.net> pisze:

> Hi,
>
> I just came across this hooks.pl snippet that allows ELinks to display
> threaded comments on Hacker News nicely indented:
>
> sub pre_format_html_hook {
>   my ($url, $html) = (shift, shift);
>   if ($url =~ m|news.ycombinator.com/item\?id=|) {
>     $html =~ s|<img src="s.gif" height=1  
> width=([0-9]{1,3})>|' 'x($1/10)|eg;
>   }
>   return $html;
> }
>
> http://pastebin.com/P4frn4N7
> https://news.ycombinator.com/item?id=6151718
>
> Hacker News uses "s.gif" with varying width values to adjust the
> indenting of comments, which ELinks doensn't recognise. The above code
> swaps those out with &nbsp entities. Looks like a nice solution, but I
> can't seem to get it working. I've had success using hooks.lua, which
> required compiling ELinks with Lua support. So I tried compiling with
> Perl support:
>
>     % ./configure --with-lua --with-perl
>       [...]
>       checking for Perl... no
>       checking for Lua... yes
>       [...]
>
> Not sure why perl isn't found...

Did you install libperl-dev?



More information about the elinks-users mailing list