Texy
class Texy
Texy! - Convert plain text to XHTML format using process().
$texy = new Texy();
$html = $texy->process($text);
Constants
ALL |
|
NONE |
|
VERSION |
|
CONTENT_MARKUP |
|
CONTENT_REPLACED |
|
CONTENT_TEXTUAL |
|
CONTENT_BLOCK |
|
FILTER_ANCHOR |
|
FILTER_IMAGE |
|
XML |
|
HTML4_TRANSITIONAL |
|
HTML4_STRICT |
|
HTML5 |
|
XHTML1_TRANSITIONAL |
|
XHTML1_STRICT |
|
XHTML5 |
|
Properties
array | $allowed | ||
true|false|array | $allowedTags | ||
true|false|array | $allowedClasses | ||
true|false|array | $allowedStyles | ||
int | $tabWidth | ||
bool | $obfuscateEmail | ||
array | $urlSchemeFilters | ||
bool | $mergeLines | ||
array | $summary | ||
array | $alignClasses | ||
bool | $removeSoftHyphens | ||
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. |
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.
Converts internal string representation to final HTML code.
Add new event handler.
Invoke registered after-handlers.
Generate unique mark - useful for freezing (folding) some substrings.
Filters bad URLs.
No description
No description
No description
No description
No description
Details
at line 202
__construct()
No description
at line 230
void
setOutputMode(int $mode)
Set HTML/XHTML output mode (overwrites self::$allowedTags)
at line 257
int
getOutputMode()
Get HTML/XHTML output mode
at line 267
protected void
loadModules()
Create array of all used modules ($this->modules).
This array can be changed by overriding this method (by subclasses)
at line 294
final void
registerLinePattern(callable $handler, string $pattern, string $name, string $againTest = null)
No description
at line 308
final void
registerBlockPattern(callable $handler, string $pattern, string $name)
No description
at line 322
final void
registerPostLine(callable $handler, string $name)
No description
at line 335
string
process(string $text, bool $singleLine = false)
Converts document in Texy! to (X)HTML code.
at line 417
string
processLine(string $text)
Converts single line in Texy! to (X)HTML code.
at line 428
string
processTypo(string $text)
Makes only typographic corrections.
at line 447
string
toText()
Converts DOM structure to pure text.
at line 460
final string
stringToHtml(string $s)
Converts internal string representation to final HTML code.
at line 499
final string
stringToText(string $s)
Converts internal string representation to final HTML code.
at line 529
final void
addHandler(string $event, callable $callback)
Add new event handler.
at line 539
final mixed
invokeAroundHandlers(string $event, Parser $parser, array $args)
Invoke registered around-handlers.
at line 553
final void
invokeHandlers(string $event, array $args)
Invoke registered after-handlers.
at line 568
final string
protect(string $child, string $contentType)
Generate unique mark - useful for freezing (folding) some substrings.
at line 588
final bool
checkURL(string $URL, string $type)
Filters bad URLs.
at line 597
final string
unProtect(string $html)
No description
at line 603
final array
getLinePatterns()
No description
at line 609
final array
getBlockPatterns()
No description
at line 615
final HtmlElement
getDOM()
No description
at line 621
final
__clone()
No description
at line 628
final static string
freezeSpaces(string $s)
deprecated
deprecated
No description
at line 636
final static string
unfreezeSpaces(string $s)
deprecated
deprecated
No description
at line 644
final static string
normalize(string $s)
deprecated
deprecated
No description
at line 652
final static string
webalize(string $s, string $charlist = null)
deprecated
deprecated
No description
at line 660
final static string
escapeHtml(string $s)
deprecated
deprecated
No description
at line 668
final static string
unescapeHtml(string $s)
deprecated
deprecated
No description
at line 676
final static string
outdent(string $s)
deprecated
deprecated
No description
at line 684
final static bool
isRelative(string $URL)
deprecated
deprecated
No description
at line 692
final static string
prependRoot(string $URL, string $root)
deprecated
deprecated
No description
Traits
Better OOP experience.