Remove markdown parser in favor of only parsing \n and **.+**

This commit is contained in:
Aaron Bieber 2023-06-28 09:44:48 -06:00
parent 84520fb498
commit 2820caa467
No known key found for this signature in database
2 changed files with 6 additions and 3 deletions

View File

@ -21,7 +21,6 @@
perl
Mojolicious
MojoSQLite
TextMarkdown
pkgs.minisign
];
buildInputs = with pkgs; [ perl ];
@ -47,7 +46,6 @@
perl
Mojolicious
MojoSQLite
TextMarkdown
pkgs.minisign
];
};

View File

@ -12,7 +12,6 @@ use feature 'switch';
use Mojolicious::Lite -signatures;
use Mojo::SQLite;
use Text::Markdown qw{markdown};
my $dbFile = "combined.db";
@ -89,6 +88,12 @@ SELECT substr('..........',1,level*3) || name FROM under_port;
my $title = "OpenBSD.app";
my $descr = "OpenBSD package search";
sub markdown($str) {
$str =~ s/\*\*(.+)\*\*/<strong>$1<\/strong>/g;
$str =~ s/\n/<br \/>/g;
return $str;
}
sub to_md ($results) {
foreach my $result (@$results) {
$result->{DESCR_MATCH} = markdown( $result->{DESCR_MATCH} );