Texy
class Texy extends TexyObject
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 | ||
TexyScriptModule | $scriptModule | ||
TexyParagraphModule | $paragraphModule | ||
TexyHtmlModule | $htmlModule | ||
TexyImageModule | $imageModule | ||
TexyLinkModule | $linkModule | ||
TexyPhraseModule | $phraseModule | ||
TexyEmoticonModule | $emoticonModule | ||
TexyBlockModule | $blockModule | ||
TexyHeadingModule | $headingModule | ||
TexyHorizLineModule | $horizLineModule | ||
TexyBlockQuoteModule | $blockQuoteModule | ||
TexyListModule | $listModule | ||
TexyTableModule | $tableModule | ||
TexyFigureModule | $figureModule | ||
TexyTypographyModule | $typographyModule | ||
TexyLongWordsModule | $longWordsModule | ||
TexyHtmlOutputModule | $htmlOutputModule | ||
array | $_classes | ||
array | $_styles | ||
array | $dtd | DTD descriptor. |
|
static | $strictDTD | DEPRECATED | |
$cleaner | |||
$xhtml |
Methods
No description
Set HTML/XHTML output mode (overwrites self::$allowedTags)
Get HTML/XHTML output mode
Create array of all used modules ($this->modules).
No description
No description
No description
Converts document in Texy! to (X)HTML code.
Converts single line in Texy! to (X)HTML code.
Makes only typographic corrections.
Converts DOM structure to pure text.
Converts internal string representation to final HTML code in UTF-8.
Converts internal string representation to final HTML code in UTF-8.
Add new event handler.
Invoke registered around-handlers.
Invoke registered after-handlers.
Translate all white spaces (\t \n \r space) to meta-spaces \x01-\x04.
Reverts meta-spaces back to normal spaces.
Removes special controls characters and normalizes line endings and spaces.
Converts to web safe characters [a-z0-9-] text.
Texy! version of htmlSpecialChars (much faster than htmlSpecialChars!).
Texy! version of html_entity_decode (always UTF-8, much faster than original!).
Outdents text block.
Generate unique mark - useful for freezing (folding) some substrings.
No description
Filters bad URLs.
Is given URL relative?
Prepends root to URL, if possible.
No description
No description
No description
No description
PHP garbage collector helper.
No description
Details
at line 215
__construct()
No description
at line 249
void
setOutputMode($mode)
Set HTML/XHTML output mode (overwrites self::$allowedTags)
at line 278
int
getOutputMode()
Get HTML/XHTML output mode
at line 288
protected
loadModules()
Create array of all used modules ($this->modules).
This array can be changed by overriding this method (by subclasses)
at line 315
final
registerLinePattern($handler, $pattern, $name, $againTest = NULL)
No description
at line 334
final
registerBlockPattern($handler, $pattern, $name)
No description
at line 353
final
registerPostLine($handler, $name)
No description
at line 375
string
process($text, $singleLine = FALSE)
Converts document in Texy! to (X)HTML code.
at line 459
string
processLine($text)
Converts single line in Texy! to (X)HTML code.
at line 470
string
processTypo($text)
Makes only typographic corrections.
at line 493
string
toText()
Converts DOM structure to pure text.
at line 507
final string
stringToHtml($s)
Converts internal string representation to final HTML code in UTF-8.
at line 546
final string
stringToText($s)
Converts internal string representation to final HTML code in UTF-8.
at line 578
final void
addHandler($event, $callback)
Add new event handler.
at line 597
final mixed
invokeAroundHandlers($event, $parser, $args)
Invoke registered around-handlers.
at line 617
final void
invokeHandlers($event, $args)
Invoke registered after-handlers.
at line 635
final static string
freezeSpaces($s)
Translate all white spaces (\t \n \r space) to meta-spaces \x01-\x04.
which are ignored by TexyHtmlOutputModule routine
at line 646
final static string
unfreezeSpaces($s)
Reverts meta-spaces back to normal spaces.
at line 657
final static string
normalize($s)
Removes special controls characters and normalizes line endings and spaces.
at line 682
final static string
webalize($s, $charlist = NULL)
Converts to web safe characters [a-z0-9-] text.
at line 698
final static string
escapeHtml($s)
Texy! version of htmlSpecialChars (much faster than htmlSpecialChars!).
note: " is not encoded!
at line 709
final static string
unescapeHtml($s)
Texy! version of html_entity_decode (always UTF-8, much faster than original!).
at line 723
final static string
outdent($s)
Outdents text block.
at line 743
final string
protect($child, $contentType)
Generate unique mark - useful for freezing (folding) some substrings.
at line 759
final
unProtect($html)
No description
at line 771
final bool
checkURL($URL, $type)
Filters bad URLs.
at line 785
final static bool
isRelative($URL)
Is given URL relative?
at line 798
final static string
prependRoot($URL, $root)
Prepends root to URL, if possible.
at line 807
final
getLinePatterns()
No description
at line 813
final
getBlockPatterns()
No description
at line 819
final
getDOM()
No description
at line 826
tabCb($m)
internal |
No description
at line 835
final
free()
PHP garbage collector helper.
at line 845
final
__clone()
No description