</%args>
<%perl>
+# typical url for this script:
+# http://www.chiark.greenend.org.uk/ucgi/~clareb/mason/pirates/routetextstring?format=json&ocean=Midnight&string=d
+
+
use CommodsWeb;
use HTML::Entities;
use JSON;
})};
$output_wrong= sub { print to_json({
success => 0,
- show => encode_entities($_[0]),
+ show => $_[0],
})};
}
if (!@$results) {
$err->('no island or arch matches "%s"');
} elsif (@$results > 3) {
- $err->('');
+ $err->(' ');
} elsif (@$results > 1) {
my @m= map { $_->[2] } @$results;
$err->('ambiguous island or arch "%s", could be '.
push @results, $results->[0];
}
-$canontext= join ' | ', map { encode_entities($_->[2]) } @results;
+$canontext= join ' | ', map { $_->[2] } @results;
$output->();