]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki/Plugin/meta.pm
Merge remote branch 'smcv/unescaped-meta'
[ikiwiki.git] / IkiWiki / Plugin / meta.pm
index 892f6b2c96a46e93e610a1690d5f19ffa50b7703..128a6342c74a4ad13adb2f0521d85ddfb29232bb 100644 (file)
@@ -88,26 +88,21 @@ sub preprocess (@) {
 
        # Metadata collection that needs to happen during the scan pass.
        if ($key eq 'title') {
-               my $encoded = HTML::Entities::encode_numeric($value);
-               $pagestate{$page}{meta}{title} = $encoded;
-
+               $pagestate{$page}{meta}{title}=$value;
                if (exists $params{sortas}) {
                        $pagestate{$page}{meta}{titlesort}=$params{sortas};
                }
-               elsif ($encoded ne $value) {
-                       $pagestate{$page}{meta}{titlesort}=$value;
-               }
                else {
                        delete $pagestate{$page}{meta}{titlesort};
                }
                return "";
        }
        elsif ($key eq 'description') {
-               $pagestate{$page}{meta}{description}=HTML::Entities::encode_numeric($value);
+               $pagestate{$page}{meta}{description}=$value;
                # fallthrough
        }
        elsif ($key eq 'guid') {
-               $pagestate{$page}{meta}{guid}=HTML::Entities::encode_numeric($value);
+               $pagestate{$page}{meta}{guid}=$value;
                # fallthrough
        }
        elsif ($key eq 'license') {
@@ -281,15 +276,20 @@ sub pagetemplate (@) {
                $template->param(meta => join("\n", grep { (! $seen{$_}) && ($seen{$_}=1) } @{$metaheaders{$page}}));
        }
        if (exists $pagestate{$page}{meta}{title} && $template->query(name => "title")) {
-               $template->param(title => $pagestate{$page}{meta}{title});
+               $template->param(title => HTML::Entities::encode_numeric($pagestate{$page}{meta}{title}));
                $template->param(title_overridden => 1);
        }
 
-       foreach my $field (qw{author authorurl description permalink}) {
+       foreach my $field (qw{author authorurl permalink}) {
                $template->param($field => $pagestate{$page}{meta}{$field})
                        if exists $pagestate{$page}{meta}{$field} && $template->query(name => $field);
        }
 
+       foreach my $field (qw{description}) {
+               $template->param($field => HTML::Entities::encode_numeric($pagestate{$page}{meta}{$field}))
+                       if exists $pagestate{$page}{meta}{$field} && $template->query(name => $field);
+       }
+
        foreach my $field (qw{license copyright}) {
                if (exists $pagestate{$page}{meta}{$field} && $template->query(name => $field) &&
                    ($page eq $destpage || ! exists $pagestate{$destpage}{meta}{$field} ||