summaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin
diff options
context:
space:
mode:
authorJoey Hess <joey@gnu.kitenet.net>2010-04-10 14:33:51 -0400
committerJoey Hess <joey@gnu.kitenet.net>2010-04-10 14:33:51 -0400
commit002d9e3cb52eadc8c2feb6bfac020b0651c6e0b7 (patch)
tree4be160afee8b309299ff60bcbf12286bf12b3ebb /IkiWiki/Plugin
parentd1a616df2ed79b1602658c5d10d54ee00afc537e (diff)
parent5408279b5ffd7038bb0c279d1379c7e0d21d0a96 (diff)
Merge remote branch 'smcv/unescaped-meta'
Conflicts: IkiWiki/Plugin/meta.pm
Diffstat (limited to 'IkiWiki/Plugin')
-rw-r--r--IkiWiki/Plugin/comments.pm4
-rw-r--r--IkiWiki/Plugin/inline.pm3
-rw-r--r--IkiWiki/Plugin/meta.pm20
3 files changed, 14 insertions, 13 deletions
diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm
index 460341710..0aa043215 100644
--- a/IkiWiki/Plugin/comments.pm
+++ b/IkiWiki/Plugin/comments.pm
@@ -221,9 +221,9 @@ sub preprocess {
}
if (defined $params{subject}) {
- # encode title the same way meta does
+ # decode title the same way meta does
eval q{use HTML::Entities};
- $pagestate{$page}{meta}{title} = HTML::Entities::encode_numeric(decode_entities($params{subject}));
+ $pagestate{$page}{meta}{title} = decode_entities($params{subject});
}
if ($params{page} =~ m/\/\Q$config{comments_pagename}\E\d+_/) {
diff --git a/IkiWiki/Plugin/inline.pm b/IkiWiki/Plugin/inline.pm
index 44919e58c..644cb588d 100644
--- a/IkiWiki/Plugin/inline.pm
+++ b/IkiWiki/Plugin/inline.pm
@@ -553,7 +553,8 @@ sub genfeed ($$$$$@) {
if (exists $pagestate{$p}) {
if (exists $pagestate{$p}{meta}{guid}) {
- $itemtemplate->param(guid => $pagestate{$p}{meta}{guid});
+ eval q{use HTML::Entities};
+ $itemtemplate->param(guid => HTML::Entities::encode_numeric($pagestate{$p}{meta}{guid}));
}
if (exists $pagestate{$p}{meta}{updated}) {
diff --git a/IkiWiki/Plugin/meta.pm b/IkiWiki/Plugin/meta.pm
index 892f6b2c9..128a6342c 100644
--- a/IkiWiki/Plugin/meta.pm
+++ b/IkiWiki/Plugin/meta.pm
@@ -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} ||