Is there a way to take a plain text file and convert it to a simple HTML?
A couple of 'sophisticated' stuff that will be great
UPDATE
I just found this HTML::FromText. Checking to see if it meets my needs...
replace(/<[^>]*>/g, '') This method is a simple and efficient way to remove the tags from the text. This method uses the string method . replace(old value,new value) which replaces the HTML tag values with the empty string.
Text::Markdown
Stack Overflow already uses Markdown because it's the best mark-up language targeted to general text to HTML conversion. Named links are explained in the editing help.
Try HTML::TextToHTML:
From the command line:
txt2html I<arguments>
From Scripts:
use HTML::TextToHTML;
# create a new object
my $conv = new HTML::TextToHTML();
# convert a file
$conv->txt2html(infile=>[$text_file],
outfile=>$html_file,
title=>"Wonderful Things",
mail=>1,
]);
# reset arguments
$conv->args(infile=>[], mail=>0);
# convert a string
$newstring = $conv->process_chunk($mystring)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With