Remove markdown parser in favor of only parsing \n and **.+**
This commit is contained in:
parent
84520fb498
commit
2820caa467
@ -21,7 +21,6 @@
|
||||
perl
|
||||
Mojolicious
|
||||
MojoSQLite
|
||||
TextMarkdown
|
||||
pkgs.minisign
|
||||
];
|
||||
buildInputs = with pkgs; [ perl ];
|
||||
@ -47,7 +46,6 @@
|
||||
perl
|
||||
Mojolicious
|
||||
MojoSQLite
|
||||
TextMarkdown
|
||||
pkgs.minisign
|
||||
];
|
||||
};
|
||||
|
@ -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} );
|
||||
|
Loading…
Reference in New Issue
Block a user