Texy
class Texy
Texy! - Convert plain text to HTML format using process().
$texy = new Texy();
$html = $texy->process($text);
Constants
VERSION |
|
ALL |
|
NONE |
|
CONTENT_MARKUP |
|
CONTENT_REPLACED |
|
CONTENT_TEXTUAL |
|
CONTENT_BLOCK |
|
FILTER_ANCHOR |
|
FILTER_IMAGE |
|
deprecated HTML4_TRANSITIONAL |
|
deprecated HTML4_STRICT |
|
deprecated HTML5 |
|
deprecated XHTML1_TRANSITIONAL |
|
deprecated XHTML1_STRICT |
|
deprecated XHTML5 |
|
deprecated XML |
|
Properties
array<string,bool> | $allowed | ||
bool|array<string,bool|array<int,string>> | $allowedTags | ||
bool|array<int,string> | $allowedClasses | ||
bool|array<int,string> | $allowedStyles | ||
int | $tabWidth | ||
bool | $obfuscateEmail | ||
(string)[] | $urlSchemeFilters | ||
bool | $mergeLines | ||
array<string,string[]> | $summary | ||
array<string,?string> | $alignClasses | ||
bool | $removeSoftHyphens | ||
string|HtmlElement | $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 |
Methods
No description
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
No description
No description
Details
at line 204
__construct()
No description
at line 248
void
setOutputMode(int $mode)
deprecated
deprecated
No description
at line 255
int
getOutputMode()
deprecated
deprecated
No description
at line 266
protected void
loadModules()
Create array of all used modules ($this->modules).
This array can be changed by overriding this method (by subclasses)
at line 293
final void
registerLinePattern(callable $handler, string $pattern, string $name, string|null $againTest = null)
No description
at line 311
final void
registerBlockPattern(callable $handler, string $pattern, string $name)
No description
at line 325
final void
registerPostLine(callable $handler, string $name)
No description
at line 338
string
process(string $text, bool $singleLine = false)
Converts document in Texy! to (X)HTML code.
at line 415
string
processLine(string $text)
Converts single line in Texy! to (X)HTML code.
at line 424
string
processTypo(string $text)
Makes only typographic corrections.
at line 443
string
toText()
Converts DOM structure to pure text.
at line 456
final string
stringToHtml(string $s)
Converts internal string representation to final HTML code.
at line 497
final string
stringToText(string $s)
Converts internal string representation to final HTML code.
at line 522
final void
addHandler(string $event, callable $callback)
Add new event handler.
at line 532
final mixed
invokeAroundHandlers(string $event, Parser $parser, array $args)
Invoke registered around-handlers.
at line 546
final void
invokeHandlers(string $event, array $args)
Invoke registered after-handlers.
at line 561
final string
protect(string $child, string $contentType)
Generate unique mark - useful for freezing (folding) some substrings.
at line 581
final bool
checkURL(string $URL, string $type)
Filters bad URLs.
at line 590
final string
unProtect(string $html)
No description
at line 597
final array
getLinePatterns()
No description
at line 604
final array
getBlockPatterns()
No description
at line 610
final HtmlElement
getDOM()
No description
at line 620
static array
getDTD()
internal |
No description
at line 627
final array
getAllowedProps()
internal |
No description
at line 633
final
__clone()
No description
at line 640
final static string
freezeSpaces(string $s)
deprecated
deprecated
No description
at line 648
final static string
unfreezeSpaces(string $s)
deprecated
deprecated
No description
at line 656
final static string
normalize(string $s)
deprecated
deprecated
No description
at line 664
final static string
webalize(string $s, string $charlist = '')
deprecated
deprecated
No description
at line 672
final static string
escapeHtml(string $s)
deprecated
deprecated
No description
at line 680
final static string
unescapeHtml(string $s)
deprecated
deprecated
No description
at line 688
final static string
outdent(string $s)
deprecated
deprecated
No description
at line 696
final static bool
isRelative(string $URL)
deprecated
deprecated
No description
at line 704
final static string
prependRoot(string $URL, string $root)
deprecated
deprecated
No description
Traits
Better OOP experience.