NAME
Konstrukt::Plugin::wiki::markup::link - Inline plugin to handle links
SYNOPSIS
my $l = use_plugin 'wiki::markup::link';
my $rv = $l->process($tag);
DESCRIPTION
This one will look for (internal and external, implicit and explicit) links and converts them into HTML-links.
CONFIGURATION
You may define a list of link plugins that will handle the different link types. The first plugin that matches a link will handle it. So the list should be sorted by descending specificity.
The defaults are:
wiki/link/plugins nolink image file external wiki
Note that the wiki plugin should be the last one in the chain since it acts like a catchall plugin ans will match all explicit links.
EXAMPLE
Implicit links
CamelCase or SomePage
http://foo.bar/baz
!NoLink
Explicit links
Explicit links are required here [[nocamelcase]] or here [[NoSpaceAroundLink]].
[[SomePage|But with some other description]]
[[http://foo.bar/baz|somthing here]]
METHODS
init
Initialization.
process
This method will do the work. Will look for new links inside the text and will also check if the target of existing wiki links exists or not.
Parameters:
$nodes - Container node (of type Konstrukt::Parser::Node) containing all (text-)nodes of this documents.
_find_matching_plugin
Will return the plugin responsible for a given link string or undef if no plugin matches.
Will only be used internally.
Parameters:
$plugins - Reference to an array containing arrayreferences each containing a matching regexp and the plugin.
$link - The link string
$type - Will be 'explicit' or 'implicit'. Determines the type of regexps to use to match the string.
AUTHOR
Copyright 2006 Thomas Wittek (mail at gedankenkonstrukt dot de). All rights reserved.
This document is free software. It is distributed under the same terms as Perl itself.