NAME
MKDoc::Text::Structured::Inline - convert text to HTML without handling block-level tags
SYNOPSIS
my $text = some_structured_text();
my $this = MKDoc::Text::Structured::Inline::process ($text);
my $that = MKDoc::Text::Structured::Inline::process_entities_only ($text);
SUMMARY
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.
USAGE
Processing text and adding HTML tags
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’
Processing text without adding tags
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’