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})>|'&nbsp;'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...

    % which perl
      /usr/bin/perl
    % which lua
      /usr/bin/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
    Features:
    [...] 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.

Thanks,

John

-- 
John Magolske
http://B79.net/contact
_______________________________________________
elinks-users mailing list
elinks-users@linuxfromscratch.org
http://linuxfromscratch.org/mailman/listinfo/elinks-users

Reply via email to