use HTML::Escape to escape html in various places

fixes #5
This commit is contained in:
Aaron Bieber 2023-09-06 07:50:12 -06:00
parent 2390695a71
commit a16aa76c09
No known key found for this signature in database
2 changed files with 4 additions and 0 deletions

View File

@ -22,6 +22,7 @@
Mojolicious
MojoSQLite
pkgs.outils
HTMLEscape
];
buildInputs = with pkgs; [ perl ];
@ -47,6 +48,7 @@
Mojolicious
MojoSQLite
pkgs.outils
HTMLEscape
];
};
});

View File

@ -10,6 +10,7 @@ use File::Basename;
use Mojolicious::Lite -signatures;
use Mojo::SQLite;
use HTML::Escape qw/escape_html/;
my $dbFile = "combined.db";
@ -88,6 +89,7 @@ my $title = "OpenBSD.app";
my $descr = "OpenBSD package search";
sub markdown ($str) {
$str = escape_html($str);
$str =~ s/\*\*(\w+)\*\*/<strong>$1<\/strong>/g;
$str =~ s/\n/<br \/>/g;
return $str;