Skip to content

Commit

Permalink
Hack for twitter cards with quote chars. Needs a better fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Apr 25, 2016
1 parent ffd5657 commit 3c8d085
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion IcculusFinger_daemon.pl
Expand Up @@ -683,9 +683,14 @@ sub output_start {
if (defined $metadata{'twitter'}) {
my $uname = $metadata{'twitter'};
my $summary = $metadata{'summary'};
my $titlestr = $title;
# !!! FIXME: we need a proper HTML encoder.
$uname = s/'/\\'/g;
$titlestr = s/'/\\'/g;
$summary = s/'/\\'/g;
$twitter .= "<meta name='twitter:card' content='summary' />\n";
$twitter .= "<meta name='twitter:site' content='\@$uname' />\n";
$twitter .= "<meta name='twitter:title' content='$title' />\n";
$twitter .= "<meta name='twitter:title' content='$titlestr' />\n";
$twitter .= "<meta name='twitter:description' content='$summary' />\n";
}

Expand Down

0 comments on commit 3c8d085

Please sign in to comment.