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 213
__construct()
No description
at line 256
void
setOutputMode($mode)
Set HTML/XHTML output mode (overwrites self::$allowedTags)
at line 285
int
getOutputMode()
Get HTML/XHTML output mode
at line 295
protected
loadModules()
Create array of all used modules ($this->modules).
This array can be changed by overriding this method (by subclasses)
at line 322
final
registerLinePattern($handler, $pattern, $name, $againTest = NULL)
No description
at line 341
final
registerBlockPattern($handler, $pattern, $name)
No description
at line 360
final
registerPostLine($handler, $name)
No description
at line 382
string
process($text, $singleLine = FALSE)
Converts document in Texy! to (X)HTML code.
at line 466
string
processLine($text)
Converts single line in Texy! to (X)HTML code.
at line 477
string
processTypo($text)
Makes only typographic corrections.
at line 500
string
toText()
Converts DOM structure to pure text.
at line 514
final string
stringToHtml($s)
Converts internal string representation to final HTML code in UTF-8.
at line 554
final string
stringToText($s)
Converts internal string representation to final HTML code in UTF-8.
at line 586
final void
addHandler($event, $callback)
Add new event handler.
at line 605
final mixed
invokeAroundHandlers($event, $parser, $args)
Invoke registered around-handlers.
at line 625
final void
invokeHandlers($event, $args)
Invoke registered after-handlers.
at line 643
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 654
final static string
unfreezeSpaces($s)
Reverts meta-spaces back to normal spaces.
at line 665
final static string
normalize($s)
Removes special controls characters and normalizes line endings and spaces.
at line 690
final static string
webalize($s, $charlist = NULL)
Converts to web safe characters [a-z0-9-] text.
at line 706
final static string
escapeHtml($s)
Texy! version of htmlSpecialChars (much faster than htmlSpecialChars!).
note: " is not encoded!
at line 717
final static string
unescapeHtml($s)
Texy! version of html_entity_decode (always UTF-8, much faster than original!).
at line 731
final static string
outdent($s)
Outdents text block.
at line 751
final string
protect($child, $contentType)
Generate unique mark - useful for freezing (folding) some substrings.
at line 767
final
unProtect($html)
No description
at line 779
final bool
checkURL($URL, $type)
Filters bad URLs.
at line 793
final static bool
isRelative($URL)
Is given URL relative?
at line 806
final static string
prependRoot($URL, $root)
Prepends root to URL, if possible.
at line 815
final
getLinePatterns()
No description
at line 821
final
getBlockPatterns()
No description
at line 827
final
getDOM()
No description
at line 834
tabCb($m)
internal |
No description
at line 843
final
free()
PHP garbage collector helper.
at line 853
final
__clone()
No description