PHP Class Texy\Texy

$texy = new Texy(); $html = $texy->process($text);
Inheritance: use trait Strict
Mostra file Open project: dg/texy Class Usage Examples

Public Properties

Property Type Description
$_classes for internal usage
$_styles for internal usage
$alignClasses CSS classes for align modifiers
$allowed Texy! syntax configuration
$allowedClasses Allowed classes
$allowedStyles Allowed inline CSS style
$allowedTags Allowed HTML tags
$blockModule Texy\Modules\BlockModule
$blockQuoteModule Texy\Modules\BlockQuoteModule
$dtd array $dtd[element][0] - allowed attributes (as array keys) $dtd[element][1] - allowed content for an element (content model) (as array keys) - array of allowed elements (as keys) - FALSE - empty element - 0 - special case for ins & del
$emoticonModule Texy\Modules\EmoticonModule
$figureModule Texy\Modules\FigureModule
$headingModule Texy\Modules\HeadingModule
$horizLineModule Texy\Modules\HorizLineModule
$htmlModule Texy\Modules\HtmlModule
$htmlOutputModule Texy\Modules\HtmlOutputModule
$imageModule Texy\Modules\ImageModule
$linkModule Texy\Modules\LinkModule
$listModule Texy\Modules\ListModule
$longWordsModule Texy\Modules\LongWordsModule
$mergeLines Paragraph merging mode
$nontextParagraph string
$obfuscateEmail Do obfuscate e-mail addresses?
$paragraphModule Texy\Modules\ParagraphModule
$phraseModule Texy\Modules\PhraseModule
$removeSoftHyphens remove soft hyphens (SHY)?
$scriptModule Texy\Modules\ScriptModule
$styleSheet Generated stylesheet
$summary Parsing summary
$tabWidth TAB width (for converting tabs to spaces)
$tableModule Texy\Modules\TableModule
$typographyModule Texy\Modules\TypographyModule
$urlSchemeFilters regexps to check URL schemes

Public Methods

Method Description
__clone ( )
__construct ( )
addHandler ( $event, $callback ) : void Add new event handler.
checkURL ( $URL, $type ) : boolean Filters bad URLs.
escapeHtml ( $s )
freezeSpaces ( $s )
getBlockPatterns ( )
getDOM ( )
getLinePatterns ( )
getOutputMode ( ) : integer Get HTML/XHTML output mode
invokeAroundHandlers ( $event, Parser $parser, array $args ) : mixed Invoke registered around-handlers.
invokeHandlers ( $event, array $args ) : void Invoke registered after-handlers.
isRelative ( $URL )
normalize ( $s )
outdent ( $s )
prependRoot ( $URL, $root )
process ( $text, $singleLine = FALSE ) : string Converts document in Texy! to (X)HTML code.
processLine ( $text ) : string Converts single line in Texy! to (X)HTML code.
processTypo ( $text ) : string Makes only typographic corrections.
protect ( $child, $contentType ) : string Generate unique mark - useful for freezing (folding) some substrings.
registerBlockPattern ( $handler, $pattern, $name )
registerLinePattern ( $handler, $pattern, $name, $againTest = NULL )
registerPostLine ( $handler, $name )
setOutputMode ( $mode ) : void Set HTML/XHTML output mode (overwrites self::$allowedTags)
stringToHtml ( $s ) : string Converts internal string representation to final HTML code.
stringToText ( $s ) : string Converts internal string representation to final HTML code.
toText ( ) : string Converts DOM structure to pure text.
unProtect ( $html )
unescapeHtml ( $s )
unfreezeSpaces ( $s )
webalize ( $s, $charlist = NULL )

Protected Methods

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

Method Details

__clone() final public method

final public __clone ( )

__construct() public method

public __construct ( )

addHandler() final public method

Add new event handler.
final public addHandler ( $event, $callback ) : void
return void

checkURL() final public method

Filters bad URLs.
final public checkURL ( $URL, $type ) : boolean
return boolean

escapeHtml() final public static method

Deprecation:
final public static escapeHtml ( $s )

freezeSpaces() final public static method

Deprecation:
final public static freezeSpaces ( $s )

getBlockPatterns() final public method

final public getBlockPatterns ( )

getDOM() final public method

final public getDOM ( )

getLinePatterns() final public method

final public getLinePatterns ( )

getOutputMode() public method

Get HTML/XHTML output mode
public getOutputMode ( ) : integer
return integer

invokeAroundHandlers() final public method

Invoke registered around-handlers.
final public invokeAroundHandlers ( $event, Parser $parser, array $args ) : mixed
$parser Parser
$args array
return mixed

invokeHandlers() final public method

Invoke registered after-handlers.
final public invokeHandlers ( $event, array $args ) : void
$args array
return void

isRelative() final public static method

Deprecation:
final public static isRelative ( $URL )

loadModules() protected method

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

normalize() final public static method

Deprecation:
final public static normalize ( $s )

outdent() final public static method

Deprecation:
final public static outdent ( $s )

prependRoot() final public static method

Deprecation:
final public static prependRoot ( $URL, $root )

process() public method

Converts document in Texy! to (X)HTML code.
public process ( $text, $singleLine = FALSE ) : string
return string output HTML code

processLine() public method

Converts single line in Texy! to (X)HTML code.
public processLine ( $text ) : string
return string output HTML code

processTypo() public method

Makes only typographic corrections.
public processTypo ( $text ) : string
return string output text

protect() final public method

Generate unique mark - useful for freezing (folding) some substrings.
final public protect ( $child, $contentType ) : string
return string internal mark

registerBlockPattern() final public method

final public registerBlockPattern ( $handler, $pattern, $name )

registerLinePattern() final public method

final public registerLinePattern ( $handler, $pattern, $name, $againTest = NULL )

registerPostLine() final public method

final public registerPostLine ( $handler, $name )

setOutputMode() public method

Set HTML/XHTML output mode (overwrites self::$allowedTags)
public setOutputMode ( $mode ) : void
return void

stringToHtml() final public method

Converts internal string representation to final HTML code.
final public stringToHtml ( $s ) : string
return string

stringToText() final public method

Converts internal string representation to final HTML code.
final public stringToText ( $s ) : string
return string

toText() public method

Converts DOM structure to pure text.
public toText ( ) : string
return string

unProtect() final public method

final public unProtect ( $html )

unescapeHtml() final public static method

Deprecation:
final public static unescapeHtml ( $s )

unfreezeSpaces() final public static method

Deprecation:
final public static unfreezeSpaces ( $s )

webalize() final public static method

Deprecation:
final public static webalize ( $s, $charlist = NULL )

Property Details

$_classes public_oe property

for internal usage
public $_classes

$_styles public_oe property

for internal usage
public $_styles

$alignClasses public_oe property

CSS classes for align modifiers
public $alignClasses

$allowed public_oe property

Texy! syntax configuration
public $allowed

$allowedClasses public_oe property

Allowed classes
public $allowedClasses

$allowedStyles public_oe property

Allowed inline CSS style
public $allowedStyles

$allowedTags public_oe property

Allowed HTML tags
public $allowedTags

$blockModule public_oe property

public BlockModule,Texy\Modules $blockModule
return Texy\Modules\BlockModule

$blockQuoteModule public_oe property

public BlockQuoteModule,Texy\Modules $blockQuoteModule
return Texy\Modules\BlockQuoteModule

$dtd public_oe property

$dtd[element][0] - allowed attributes (as array keys) $dtd[element][1] - allowed content for an element (content model) (as array keys) - array of allowed elements (as keys) - FALSE - empty element - 0 - special case for ins & del
public array $dtd
return array

$emoticonModule public_oe property

public EmoticonModule,Texy\Modules $emoticonModule
return Texy\Modules\EmoticonModule

$figureModule public_oe property

public FigureModule,Texy\Modules $figureModule
return Texy\Modules\FigureModule

$headingModule public_oe property

public HeadingModule,Texy\Modules $headingModule
return Texy\Modules\HeadingModule

$horizLineModule public_oe property

public HorizLineModule,Texy\Modules $horizLineModule
return Texy\Modules\HorizLineModule

$htmlModule public_oe property

public HtmlModule,Texy\Modules $htmlModule
return Texy\Modules\HtmlModule

$htmlOutputModule public_oe property

public HtmlOutputModule,Texy\Modules $htmlOutputModule
return Texy\Modules\HtmlOutputModule

$imageModule public_oe property

public ImageModule,Texy\Modules $imageModule
return Texy\Modules\ImageModule

$linkModule public_oe property

public LinkModule,Texy\Modules $linkModule
return Texy\Modules\LinkModule

$listModule public_oe property

public ListModule,Texy\Modules $listModule
return Texy\Modules\ListModule

$longWordsModule public_oe property

public LongWordsModule,Texy\Modules $longWordsModule
return Texy\Modules\LongWordsModule

$mergeLines public_oe property

Paragraph merging mode
public $mergeLines

$nontextParagraph public_oe property

public string $nontextParagraph
return string

$obfuscateEmail public_oe property

Do obfuscate e-mail addresses?
public $obfuscateEmail

$paragraphModule public_oe property

public ParagraphModule,Texy\Modules $paragraphModule
return Texy\Modules\ParagraphModule

$phraseModule public_oe property

public PhraseModule,Texy\Modules $phraseModule
return Texy\Modules\PhraseModule

$removeSoftHyphens public_oe property

remove soft hyphens (SHY)?
public $removeSoftHyphens

$scriptModule public_oe property

public ScriptModule,Texy\Modules $scriptModule
return Texy\Modules\ScriptModule

$styleSheet public_oe property

Generated stylesheet
public $styleSheet

$summary public_oe property

Parsing summary
public $summary

$tabWidth public_oe property

TAB width (for converting tabs to spaces)
public $tabWidth

$tableModule public_oe property

public TableModule,Texy\Modules $tableModule
return Texy\Modules\TableModule

$typographyModule public_oe property

public TypographyModule,Texy\Modules $typographyModule
return Texy\Modules\TypographyModule

$urlSchemeFilters public_oe property

regexps to check URL schemes
public $urlSchemeFilters