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

John Magolske listmail at b79.net
Tue Aug 6 08:12:27 PDT 2013


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;


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

    % which perl
    % which lua

A subsequent `make` leaves a binary that has no mention of Perl:

    ./elinks --version
    ELinks 0.13.GIT
    Built on Aug  5 2013 22:48:20
    [...] Scripting (Lua)

Any ideas as to why? Is it possible to have support for more than one
scripting language in a given binary? FWIW, this is on Debian Sid.



John Magolske

More information about the elinks-users mailing list