chiark / gitweb /
prefer to use ids to names; names aren't even valid in divs
[ypp-sc-tools.db-live.git] / yarrg / web / routetextstring
index b84fd8447708e70b4b463ab10fdf2719545cc1d0..4202ce9a4881b69c2343ca00400f52105d926d2b 100644 (file)
@@ -29,7 +29,8 @@ if ($format =~ 'json') {
        $r->content_type($ctype or $format);
        $output= sub { print to_json({
                success => 1,
-               show => encode_entities($canontext),
+               show => length $canontext ? encode_entities($canontext)
+                       : ' ',
        })};
        $output_wrong= sub { print to_json({
                success => 0,
@@ -60,7 +61,7 @@ foreach my $each (split m#[/|,]#, $string) {
        push @results, $results->[0];
 }
 
-$canontext= join ' | ', map { encode_entities($_->[2]) } @results;
+$canontext= join ' | ', map { $_->[2] } @results;
 
 $output->();