MKDoc::Text::Structured::Inline - convert text to HTML without handling block-level tags
my $text = some_structured_text(); my $this = MKDoc::Text::Structured::Inline::process ($text); my $that = MKDoc::Text::Structured::Inline::process_entities_only ($text);
MKDoc::Text::Structured::Inline is used by MKDoc::Text::Structured to generate inline HTML elements such as hyperlinks, emphasis and entities.
This module is also useful directly when the full block-level rendering of MKDoc::Text::Structured is unwanted.
For example, when processing text that is going to end up in an <h1> header, you wouldn't want any block level tags generated:
$header = "< My (c) symbol should be *bold* > -- and http://example.com/ 'linked'"; $header = MKDoc::Text::Structured::Inline::process ($title);
$header is now:
< My © symbol should be <strong>bold</strong> > — and <a href="http://example.com/">http://example.com/<a> ‘linked’
Another example, if you were processing text that will end up in an HTML <title> tag, this tag should never contain any other tags, so you should use the MKDoc::Text::Structured::Inline::process_entities_only() method:
$title = "< My (c) symbol shouldn't be *bold* > -- or http://example.com/ 'linked'"; $title = MKDoc::Text::Structured::Inline::process_entities_only ($title);
$title is now:
< My © symbol shouldn't be *bold* — > or http://example.com/ ‘linked’
To install MKDoc::Text::Structured, copy and paste the appropriate command in to your terminal.
cpanm
cpanm MKDoc::Text::Structured
CPAN shell
perl -MCPAN -e shell install MKDoc::Text::Structured
For more information on module installation, please visit the detailed CPAN module installation guide.