I think your best bet is to officially declare that your application accepts Markdown format, and then add some tweaks for anything that Word produces which doesn't format the way you like. For instance, start with the
CommonMark library, and if it doesn't like those bullet point characters in your example, you could write a quick search/replace of
$text =~ s/\x{2022}/*/g; or whatever is required to make it valid Markdown.
I suggest Markdown because it's the most common rich-text-in-plain-text format on the Internet, and because there's no standard I'm aware of to receive MS Word formatting into a standard HTML form element. I expect there are custom MS extensions for Edge that can do it, but I don't have a desktop install of Word available to test with. Building on Markdown also helps with identifying indent levels of nested lists, which would be unreasonably hard to do with regexes.
There are also fully-featured javascript client-side rich text editors like CKEditor which you could integrate, and those will submit HTML to the back-end, no Perl translation required. They may have much better support for stuff pasted from Word, but some require a paid license for professional use, and you'd have to spend some time finding which one works the best for your use case.
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.