commit 1b72ce6782fd4bdd454b6a22dc132302b394fa1c
parent 5105c22ed425ce5b0698a7b5e1fab8fa3a25fc12
Author: Samir Parikh <noreply@samirparikh.com>
Date: Fri, 10 Feb 2023 22:45:10 +0000
process text as markdown and then convert to HTML
Diffstat:
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/cgi/spsp.cgi b/cgi/spsp.cgi
@@ -72,6 +72,7 @@ my $AUTHOR = "Samir Parikh";
my $HEADING = "Samir's Updates";
my $cgi = CGI->new;
+my $markdown_to_html = Text::Markdown->new;
sub generate_post_id ( $id_length )
{
@@ -166,7 +167,9 @@ foreach my $post ( @posts )
{
print "<p><strong><a href=\"$post->{ $ID }.html\">$post->{ $TITLE }</a></strong>\n"
unless ( $post->{ $TITLE } eq '' );
- print "<p>$post->{ $STATUS }\n";
+ #print "<p>$post->{ $STATUS }\n";
+ my $html = $markdown_to_html->markdown( $post->{ $STATUS } );
+ print $html, "\n";
print "<p><a href=\"$post->{ $ID }.html\">$post->{ $TIMESTAMP }</a>\n";
print "<hr>\n";
}
@@ -217,7 +220,9 @@ EOF
print "<p><strong><a href=\"$post{ $ID }.html\">$post{ $TITLE }</a></strong>\n"
unless ( $post{ $TITLE } eq '' );
-print "<p>$post{ $STATUS }\n";
+#print "<p>$post{ $STATUS }\n";
+my $html = $markdown_to_html->markdown( $post{ $STATUS } );
+print $html, "\n";
print "<p><a href=\"$post{ $ID }.html\">$post{ $TIMESTAMP }</a>\n";
print "<hr>\n";