class Texy

Texy! - Convert plain text to XHTML format using process().

$texy = new Texy();
$html = $texy->process($text);

Constants

ALL

NONE

VERSION

REVISION

CONTENT_MARKUP

CONTENT_REPLACED

CONTENT_TEXTUAL

CONTENT_BLOCK

FILTER_ANCHOR

FILTER_IMAGE

XML

HTML4_TRANSITIONAL

HTML4_STRICT

HTML5

XHTML1_TRANSITIONAL

XHTML1_STRICT

XHTML5

Properties

string $encoding
array $allowed
true|false|array $allowedTags
true|false|array $allowedClasses
true|false|array $allowedStyles
int $tabWidth
bool $obfuscateEmail
array $urlSchemeFilters
bool $mergeLines
array $summary
string $styleSheet
array $alignClasses
bool $removeSoftHyphens
static deprecated $advertisingNotice
string $nontextParagraph
ScriptModule $scriptModule
ParagraphModule $paragraphModule
HtmlModule $htmlModule
ImageModule $imageModule
LinkModule $linkModule
PhraseModule $phraseModule
EmoticonModule $emoticonModule
BlockModule $blockModule
HeadingModule $headingModule
HorizLineModule $horizLineModule
BlockQuoteModule $blockQuoteModule
ListModule $listModule
TableModule $tableModule
FigureModule $figureModule
TypographyModule $typographyModule
LongWordsModule $longWordsModule
HtmlOutputModule $htmlOutputModule
array $_classes
array $_styles
array $dtd

DTD descriptor.

static $strictDTD DEPRECATED
$cleaner
$xhtml

Methods

__construct()

No description

void
setOutputMode($mode)

Set HTML/XHTML output mode (overwrites self::$allowedTags)

int
getOutputMode()

Get HTML/XHTML output mode

loadModules()

Create array of all used modules ($this->modules).

registerLinePattern($handler, $pattern, $name, $againTest = null)

No description

registerBlockPattern($handler, $pattern, $name)

No description

registerPostLine($handler, $name)

No description

string
process($text, $singleLine = false)

Converts document in Texy! to (X)HTML code.

string
processLine($text)

Converts single line in Texy! to (X)HTML code.

string
processTypo($text)

Makes only typographic corrections.

string
toText()

Converts DOM structure to pure text.

string
stringToHtml($s)

Converts internal string representation to final HTML code in UTF-8.

string
stringToText($s)

Converts internal string representation to final HTML code in UTF-8.

void
addHandler($event, $callback)

Add new event handler.

mixed
invokeAroundHandlers($event, Parser $parser, array $args)

Invoke registered around-handlers.

void
invokeHandlers($event, array $args)

Invoke registered after-handlers.

string
protect($child, $contentType)

Generate unique mark - useful for freezing (folding) some substrings.

bool
checkURL($URL, $type)

Filters bad URLs.

unProtect($html)

No description

getLinePatterns()

No description

getBlockPatterns()

No description

getDOM()

No description

__clone()

No description

static 
freezeSpaces($s) deprecated

No description

static 
unfreezeSpaces($s) deprecated

No description

static 
normalize($s) deprecated

No description

static 
webalize($s, $charlist = null) deprecated

No description

static 
escapeHtml($s) deprecated

No description

static 
unescapeHtml($s) deprecated

No description

static 
outdent($s) deprecated

No description

static 
isRelative($URL) deprecated

No description

static 
prependRoot($URL, $root) deprecated

No description

free() deprecated

No description

Details

at line 217
__construct()

No description

at line 260
void setOutputMode($mode)

Set HTML/XHTML output mode (overwrites self::$allowedTags)

Parameters

$mode

Return Value

void

at line 289
int getOutputMode()

Get HTML/XHTML output mode

Return Value

int

at line 299
protected loadModules()

Create array of all used modules ($this->modules).

This array can be changed by overriding this method (by subclasses)

at line 326
final registerLinePattern($handler, $pattern, $name, $againTest = null)

No description

Parameters

$handler
$pattern
$name
$againTest

at line 345
final registerBlockPattern($handler, $pattern, $name)

No description

Parameters

$handler
$pattern
$name

at line 364
final registerPostLine($handler, $name)

No description

Parameters

$handler
$name

at line 386
string process($text, $singleLine = false)

Converts document in Texy! to (X)HTML code.

Parameters

$text
$singleLine

Return Value

string

output HTML code

at line 472
string processLine($text)

Converts single line in Texy! to (X)HTML code.

Parameters

$text

Return Value

string

output HTML code

at line 483
string processTypo($text)

Makes only typographic corrections.

Parameters

$text

Return Value

string

output text (in UTF-8)

at line 506
string toText()

Converts DOM structure to pure text.

Return Value

string

at line 520
final string stringToHtml($s)

Converts internal string representation to final HTML code in UTF-8.

Parameters

$s

Return Value

string

at line 560
final string stringToText($s)

Converts internal string representation to final HTML code in UTF-8.

Parameters

$s

Return Value

string

at line 592
final void addHandler($event, $callback)

Add new event handler.

Parameters

$event
$callback

Return Value

void

at line 607
final mixed invokeAroundHandlers($event, Parser $parser, array $args)

Invoke registered around-handlers.

Parameters

$event
Parser $parser
array $args

Return Value

mixed

at line 622
final void invokeHandlers($event, array $args)

Invoke registered after-handlers.

Parameters

$event
array $args

Return Value

void

at line 640
final string protect($child, $contentType)

Generate unique mark - useful for freezing (folding) some substrings.

Parameters

$child
$contentType

Return Value

string

internal mark

at line 662
final bool checkURL($URL, $type)

Filters bad URLs.

Parameters

$URL
$type

Return Value

bool

at line 671
final unProtect($html)

No description

Parameters

$html

at line 677
final getLinePatterns()

No description

at line 683
final getBlockPatterns()

No description

at line 689
final getDOM()

No description

at line 695
final __clone()

No description

at line 702
final static freezeSpaces($s) deprecated

deprecated

No description

Parameters

$s

at line 709
final static unfreezeSpaces($s) deprecated

deprecated

No description

Parameters

$s

at line 716
final static normalize($s) deprecated

deprecated

No description

Parameters

$s

at line 723
final static webalize($s, $charlist = null) deprecated

deprecated

No description

Parameters

$s
$charlist

at line 730
final static escapeHtml($s) deprecated

deprecated

No description

Parameters

$s

at line 737
final static unescapeHtml($s) deprecated

deprecated

No description

Parameters

$s

at line 744
final static outdent($s) deprecated

deprecated

No description

Parameters

$s

at line 751
final static isRelative($URL) deprecated

deprecated

No description

Parameters

$URL

at line 758
final static prependRoot($URL, $root) deprecated

deprecated

No description

Parameters

$URL
$root

at line 765
final free() deprecated

deprecated

No description

Traits

Better OOP experience.