if (! length $stylesheet) {
error gettext("stylesheet not found")
}
- push @{$metaheaders{$page}}, '<link href="'.urlto($stylesheet, $page).
+ push @{$metaheaders{$page}}, scrub('<link href="'.urlto($stylesheet, $page).
'" rel="'.encode_entities($rel).
'" title="'.encode_entities($title).
- "\" type=\"text/css\" />";
+ "\" type=\"text/css\" />", $page, $destpage);
+ }
+ elsif ($key eq 'script') {
+ my $defer=exists $params{defer} ? ' defer="defer"' : '';
+ my $async=exists $params{async} ? ' async="async"' : '';
+ my $js=bestlink($page, $value.".js");
+ if (! length $js) {
+ error gettext("script not found");
+ }
+ push @{$metaheaders{$page}}, scrub('<script src="'.urlto($js, $page).
+ '"' . $defer . $async . ' type="text/javascript" />',
+ $page, $destpage);
}
elsif ($key eq 'openid') {
my $delegate=0; # both by default