I suppose CGI script authors periodically encounter a need to allow
users to put some input into a textarea and have that input become part
of some web page. In some cases, users want to be able to format their
input and they may or may not know HTML.
I've got a first stab at a module to address this situation. It's only
intended to cover roughly "textarea input", rather than any arbitrary
HTML page worth of content. The idea is to cover your basic blog or
slashdot type of discussion input, not to support HTML page authoring.
The code will identify paragraphs, including preformated sections (which
can be indented or identified with email-style angle-bracket-prefix
quoting). The code will translate
*email* style /markup/
into
html style
markup
and translate a line of dashes into a horizontal rule.
The tags used for
paragraphs and preformated sections are programmer-configurable, as is
the type of _text markup_ to be supported.
There are other options for allowing links, labeling link destinations
(a la slashdot) breaking long words, etc.
You can find info at
http://wickline.org/pause/_scratchwork_/HfT/
module source
module pod-as-html
a script to play with
source of said script
The script lets you tweak all of the various config options and supply
arbitrary input, and then see what the resulting output would be. It's
basically a more pleasant way to play-test the module than
writing/editing a script to use it.
I'm wondering whether folks think this should be CPAN'ed. What should be
changed? What should stay the same? What name should it have?
Thanks for your time :)
-matt
Edit kudra,
2002-04-19
Changed title per ntc request
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.