Text_Wiki
[ class tree: Text_Wiki ] [ index: Text_Wiki ] [ all elements ]

Class: Text_Wiki_Parse_Default_Url

Source Location: /Text_Wiki-1.2.4/Text/Wiki/Parse/Default/Url.php

Class Overview

Text_Wiki_Parse
   |
   --Text_Wiki_Parse_Default_Url

Parse for URLS in the source text.


Author(s):

Version:

  • Release: @package_version@

Variables

Methods


Inherited Variables

Inherited Methods

Class: Text_Wiki_Parse

Text_Wiki_Parse::__construct()
Constructor for this parser rule.
Text_Wiki_Parse::Text_Wiki_Parse()
Constructor for this parser rule.
Text_Wiki_Parse::getAttrs()
Extract 'attribute="value"' portions of wiki markup.
Text_Wiki_Parse::getConf()
Simple method to safely get configuration key values.
Text_Wiki_Parse::parse()
Abstrct method to parse source text for matches.
Text_Wiki_Parse::process()
Abstract method to generate replacements for matched text.

Class Details

[line 52]
Parse for URLS in the source text.

Various URL markings are supported: inline (the URL by itself), numbered or footnote reference (where the URL is enclosed in square brackets), and named reference (where the URL is enclosed in square brackets and has a name included inside the brackets). E.g.:

inline -- http://example.com numbered -- [http://example.com] described -- [http://example.com Example Description]

When rendering a URL token, this will convert URLs pointing to a .gif, .jpg, or .png image into an inline <img /> tag (for the 'xhtml' format).

Token options are:

'type' => ['inline'|'footnote'|'descr'] the type of URL

'href' => the URL link href portion

'text' => the displayed text of the URL link

  • Author: Paul M. Jones <pmjones@php.net>
  • Version: Release: @package_version@


[ Top ]


Class Variables

$conf = array(
        'schemes' => array(
            'http://',
            'https://',
            'ftp://',
            'gopher://',
            'news://',
            'mailto:'
        ))

[line 78]

URL schemes recognized by this rule.
  • Access: public

Type:   array
Overrides:   Array


[ Top ]

$footnoteCount =  0

[line 65]

Keeps a running count of numbered-reference URLs.
  • Access: public

Type:   int


[ Top ]



Method Detail

Text_Wiki_Parse_Default_Url (Constructor)   [line 133]

Text_Wiki_Parse_Default_Url Text_Wiki_Parse_Default_Url( &$obj)

Constructor.

We override the constructor so we can comment the regex nicely.

  • Access: public

Parameters:

   &$obj   — 

[ Top ]

__construct (Constructor)   [line 100]

Text_Wiki_Parse_Default_Url __construct( &$obj)

Constructor.

We override the constructor so we can comment the regex nicely.

  • Access: public

Overrides Text_Wiki_Parse::__construct() (Constructor for this parser rule.)

Parameters:

   &$obj   — 

[ Top ]

parse   [line 147]

void parse( )

Find three different kinds of URLs in the source text.
  • Access: public

Overrides Text_Wiki_Parse::parse() (Abstrct method to parse source text for matches.)
[ Top ]

process   [line 216]

string process( array &$matches, array $matches)

Process inline URLs.
  • Return: The processed text replacement.

Overrides Text_Wiki_Parse::process() (Abstract method to generate replacements for matched text.)

Parameters:

array   &$matches   — 
array   $matches   —  An array of matches from the parse() method as generated by preg_replace_callback. $matches[0] is the full matched string, $matches[1] is the first matched pattern, $matches[2] is the second matched pattern, and so on.

[ Top ]

processDescr   [line 283]

string processDescr( array &$matches, array $matches)

Process described-reference (named-reference) URLs.

Token options are: 'type' => ['inline'|'footnote'|'descr'] the type of URL 'href' => the URL link href portion 'text' => the displayed text of the URL link

  • Return: The processed text replacement.

Parameters:

array   &$matches   — 
array   $matches   —  An array of matches from the parse() method as generated by preg_replace_callback. $matches[0] is the full matched string, $matches[1] is the first matched pattern, $matches[2] is the second matched pattern, and so on.

[ Top ]

processFootnote   [line 246]

string processFootnote( array &$matches, array $matches)

Process numbered (footnote) URLs.

Token options are:

  • Return: The processed text replacement.

Parameters:

array   &$matches   — 
array   $matches   —  An array of matches from the parse() method as generated by preg_replace_callback. $matches[0] is the full matched string, $matches[1] is the first matched pattern, $matches[2] is the second matched pattern, and so on.

[ Top ]


Documentation generated on Tue, 12 Mar 2019 21:49:23 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.