\Horde_Text_Filter_Html2text

Takes HTML and converts it to formatted, plain text.

Optional parameters to constructor:

callback     - (callback) Callback triggered on every node. Passed the
               DOMDocument object and the DOMNode object. If the callback
               returns non-null, add this text to the output and skip further
               processing of the node.
width        - (integer) The wrapping width. Set to 0 to not wrap.
nestingLimit - (integer) The limit on node nesting. If empty, no limit.
                    
                                        
                    

Summary

Methods
Properties
Constants
__construct()
preProcess()
getPatterns()
postProcess()
No public properties found
No constants found
_node()
_buildLinkList()
$_params
$_linkList
$_indent
$_nestingLevel
N/A
No private methods found
No private properties found
N/A

Properties

$_params

$_params : array

Filter parameters.

Type

array

$_linkList

$_linkList : array

The list of links contained in the message.

Type

array

$_indent

$_indent : integer

Current list indentation level.

Type

integer

$_nestingLevel

$_nestingLevel : integer

Current nesting level.

Type

integer

Methods

__construct()

__construct(array  $params = array()) 

Constructor.

Parameters

array $params

Any parameters that the filter instance needs.

preProcess()

preProcess(string  $text) : string

Executes any code necessary before applying the filter patterns.

Parameters

string $text

The text before the filtering.

Returns

string —

The modified text.

getPatterns()

getPatterns() : array

Returns a hash with replace patterns.

Returns

array —

Patterns hash.

postProcess()

postProcess(string  $text) : string

Executes any code necessary after applying the filter patterns.

Parameters

string $text

The text after the filtering.

Returns

string —

The modified text.

_node()

_node(\DOMDocument  $doc, \DOMElement  $node) : string

Process DOM node.

Parameters

\DOMDocument $doc

Document node.

\DOMElement $node

Element node.

Returns

string —

The plaintext representation.

_buildLinkList()

_buildLinkList(\DOMDocument  $doc, \DOMElement  $node) 

Maintains an internal list of links to be displayed at the end of the text, with numeric indices to the original point in the text they appeared.

Parameters

\DOMDocument $doc

Document node.

\DOMElement $node

Element node.