- api
- since 7.5.0.0
Constants |
public Highlight
|
Methods |
public __construct( $loadAllLanguages = true)
|
public static clearAllLanguages() Clear all registered languages.
|
public disableSafeMode()
|
public enableSafeMode()
|
public getAliasesForLanguage( $name) Returns list of all available aliases for given language name.
|
public getClassPrefix() Get the class prefix string.
|
public getTabReplace() Get the tab replacement string.
|
public highlight( $languageName, $code, $ignoreIllegals = true, $continuation = NULL) Core highlighting function. Accepts a language name, or an alias, and a
|
public highlightAuto( $code, $languageSubset = NULL) Highlight the given code by highlighting the given code with each
|
public static listBundledLanguages() Return a list of all available languages bundled with this library.
|
public static listRegisteredLanguages( $includeAliases = false) Return a list of all the registered languages. Using this list in
|
public static registerAllLanguages() Register all 185+ languages that are bundled in this library. To register languages individually, use
|
public static registerLanguage( $languageId, $filePath, $overwrite = false) Register a language definition with the Highlighter's internal language
|
public setAutodetectLanguages(array $set) Set the languages that will used for auto-detection. When using auto-
|
public setClassPrefix( $classPrefix) Set the class prefix string.
|
public setTabReplace( $tabReplace) Set the tab replacement string. This defaults to NULL: no tabs
|
Properties |
private static $aliases = ['php' => 'php', 'php3' => 'php', 'php4' => 'php', 'php5' => 'php', 'php6' => 'php', 'php7' => 'php']
|
private static $bundledLanguages = []
|
private static $classMap = ['php' => Highlight
|
private $codeToHighlight = NULL
|
private $continuations = []
|
private $ignoreIllegals = false
|
private $language = NULL
|
private static $languages = ['php']
|
private $lastMatch = NULL
|
private $modeBuffer = ''
|
private $options = NULL
|
private $relevance = 0
|
private $result = ''
|
private $safeMode = true
|
private $top = NULL
|
Methods |
private autoDetection( $name) Determine whether or not a language definition supports auto detection.
|
private buildSpan( $className, $insideSpan, $leaveOpen = false, $noPrefix = false)
|
private doBeginMatch( $match)
|
private doEndMatch( $match)
|
private endOfMode( $mode, $lexeme)
|
private escape( $value)
|
private escapeRe( $value)
|
private getLanguage( $name)
|
private keywordMatch( $mode, $match)
|
private processBuffer()
|
private processKeywords()
|
private processLexeme( $textBeforeMatch, $match = NULL)
|
private processSubLanguage()
|
private replaceTabs( $code) Replace tabs for something more usable.
|
private startNewMode( $mode)
|
private testRe( $re, $lexeme)
|
Properties |
private static $aliases = ['php' => 'php', 'php3' => 'php', 'php4' => 'php', 'php5' => 'php', 'php6' => 'php', 'php7' => 'php']
|
private static $bundledLanguages = []
|
private static $classMap = ['php' => Highlight
|
private static $languages = ['php']
|
Methods |
public static clearAllLanguages() Clear all registered languages.
|
public static listBundledLanguages() Return a list of all available languages bundled with this library.
|
public static listRegisteredLanguages( $includeAliases = false) Return a list of all the registered languages. Using this list in
|
public static registerAllLanguages() Register all 185+ languages that are bundled in this library. To register languages individually, use
|
public static registerLanguage( $languageId, $filePath, $overwrite = false) Register a language definition with the Highlighter's internal language
|