aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorArne Georg Gleditsch <argggh@lxr.linpro.no>2007-11-22 12:32:35 +0100
committerArne Georg Gleditsch <argggh@lxr.linpro.no>2007-11-22 12:32:35 +0100
commit0a7345dfa8a6d061e13394fdbe31c77231f1847c (patch)
tree1cb7d9ee680268aea821fc8ca4a1c318b3289f9c /lib
parent8c978d76179b4f573c1eb9b9bb9db966c81330bb (diff)
IE fixes, HTML fixes, ++
Diffstat (limited to 'lib')
-rw-r--r--lib/LXRng/Context.pm1
-rw-r--r--lib/LXRng/Lang.pm5
-rw-r--r--lib/LXRng/Markup/File.pm13
3 files changed, 11 insertions, 8 deletions
diff --git a/lib/LXRng/Context.pm b/lib/LXRng/Context.pm
index caaa473..dab03e3 100644
--- a/lib/LXRng/Context.pm
+++ b/lib/LXRng/Context.pm
@@ -50,6 +50,7 @@ sub new {
if ($$self{'config'}) {
$$self{'release'} ||= $$self{'config'}{'ver_default'};
+ $$self{'release'} ||= $$self{'config'}{'ver_list'}[0];
}
return $self;
diff --git a/lib/LXRng/Lang.pm b/lib/LXRng/Lang.pm
index 7e6c278..754cb72 100644
--- a/lib/LXRng/Lang.pm
+++ b/lib/LXRng/Lang.pm
@@ -28,9 +28,10 @@ use vars qw(@languages %deftypes %defweight);
qw(c f i n s t u p x v d e g m l) };
-sub import {
- my ($self, @langs) = @_;
+sub init {
+ my ($self, $context) = @_;
+ my @langs = @{$context->config->{'languages'} || []};
push(@langs, 'Undefined');
foreach my $l (@langs) {
eval "require LXRng::Lang::$l";
diff --git a/lib/LXRng/Markup/File.pm b/lib/LXRng/Markup/File.pm
index abb763c..3983a3c 100644
--- a/lib/LXRng/Markup/File.pm
+++ b/lib/LXRng/Markup/File.pm
@@ -30,11 +30,9 @@ sub make_format_newline {
$line++;
$nl = safe_html($nl);
- # id="<num>" is not valid XHTML 1.0, but it is an extremely
- # handy shorthand for generating line numbers that don't
- # affect cut-n-paste.
- return qq{$nl<a id="L$line" name="L$line"></a>}.
- qq{<a href="$name#L$line" id="$line" class="line"></a>};
+ return qq{</span>$nl<li>}.
+ qq{<a href="$name#L$line" class="line"><span></span></a>}.
+ qq{<a id="L$line" name="L$line"></a><span class="line">};
}
}
@@ -98,7 +96,10 @@ sub format_code {
sub format_raw {
my ($self, $str) = @_;
- return safe_html($str);
+ $str = safe_html($str);
+ $str =~ s((http://[^/\"]+(/[^\s\"]*|)[^.\,\)\>\"]))
+ (<a href="$1">$1</a>)g;
+ return $str;
}
sub markupfile {