summaryrefslogtreecommitdiff
path: root/ikiwiki
diff options
context:
space:
mode:
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2006-03-29 03:18:21 +0000
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2006-03-29 03:18:21 +0000
commite41dd1e24e345c974fe4a070088f0d09d1b6ddac (patch)
tree1e38ae17bb30573304f633ae9fe19dbf4935f562 /ikiwiki
parentbfe959167a9bad17cc23f9f8e9920aa2f2eaec1c (diff)
html validation fixes:
- escape & in urls (also clean up cgi url generation) - since markdown wraps inlined pages in <p></p>, close and re-open the paragraph tags when generating the embedded html - added XHTML 1.0 doctypes to templates - fixed <hr /> and <br /> in templates - add an alt attribute to inline images, based on the WikiLink to the image. Allows things like [[my_image|img.png]] to customise alt text.
Diffstat (limited to 'ikiwiki')
-rwxr-xr-xikiwiki12
1 files changed, 10 insertions, 2 deletions
diff --git a/ikiwiki b/ikiwiki
index 44a7abaf4..62a9767b9 100755
--- a/ikiwiki
+++ b/ikiwiki
@@ -259,6 +259,12 @@ sub titlepage ($) { #{{{
return $title;
} #}}}
+sub cgiurl (@) { #{{{
+ my %params=@_;
+
+ return $config{cgiurl}."?".join("&amp;", map "$_=$params{$_}", keys %params);
+} #}}}
+
sub htmllink ($$;$$$) { #{{{
my $page=shift;
my $link=shift;
@@ -286,13 +292,15 @@ sub htmllink ($$;$$$) { #{{{
$bestlink=htmlpage($bestlink);
}
if (! grep { $_ eq $bestlink } values %renderedfiles) {
- return "<span><a href=\"$config{cgiurl}?do=create&page=$link&from=$page\">?</a>$linktext</span>"
+ return "<span><a href=\"".
+ cgiurl(do => "create", page => $link, from =>$page).
+ "\">?</a>$linktext</span>"
}
$bestlink=File::Spec->abs2rel($bestlink, dirname($page));
if (! $noimageinline && isinlinableimage($bestlink)) {
- return "<img src=\"$bestlink\">";
+ return "<img src=\"$bestlink\" alt=\"$linktext\">";
}
return "<a href=\"$bestlink\">$linktext</a>";
} #}}}