MediaWiki REL1_40
|
Highlight bits of wikitext. More...
Public Member Functions | |
__construct ( $cleanupWikitext=true) | |
highlightNone ( $text, $contextlines=self::DEFAULT_CONTEXT_LINES, $contextchars=self::DEFAULT_CONTEXT_CHARS) | |
Returns the first few lines of the text. | |
highlightSimple ( $text, $terms, $contextlines=self::DEFAULT_CONTEXT_LINES, $contextchars=self::DEFAULT_CONTEXT_CHARS) | |
Simple & fast snippet extraction, but gives completely irrelevant snippets. | |
highlightText ( $text, $terms, $contextlines=self::DEFAULT_CONTEXT_LINES, $contextchars=self::DEFAULT_CONTEXT_CHARS) | |
Wikitext highlighting when $wgAdvancedSearchHighlighting = true. | |
Public Attributes | |
const | DEFAULT_CONTEXT_CHARS = 75 |
const | DEFAULT_CONTEXT_LINES = 2 |
Protected Attributes | |
$mCleanWikitext = true | |
Highlight bits of wikitext.
Definition at line 35 of file SearchHighlighter.php.
SearchHighlighter::__construct | ( | $cleanupWikitext = true | ) |
bool | $cleanupWikitext |
Definition at line 47 of file SearchHighlighter.php.
SearchHighlighter::highlightNone | ( | $text, | |
$contextlines = self::DEFAULT_CONTEXT_LINES, | |||
$contextchars = self::DEFAULT_CONTEXT_CHARS ) |
Returns the first few lines of the text.
string | $text | |
int | $contextlines | Max number of returned lines |
int | $contextchars | Average number of characters per line |
Definition at line 583 of file SearchHighlighter.php.
SearchHighlighter::highlightSimple | ( | $text, | |
$terms, | |||
$contextlines = self::DEFAULT_CONTEXT_LINES, | |||
$contextchars = self::DEFAULT_CONTEXT_CHARS ) |
Simple & fast snippet extraction, but gives completely irrelevant snippets.
Used when $wgAdvancedSearchHighlighting is false.
string | $text | |
string[] | $terms | Escaped for regex by SearchDatabase::regexTerm() |
int | $contextlines | |
int | $contextchars |
Definition at line 531 of file SearchHighlighter.php.
References $lines.
SearchHighlighter::highlightText | ( | $text, | |
$terms, | |||
$contextlines = self::DEFAULT_CONTEXT_LINES, | |||
$contextchars = self::DEFAULT_CONTEXT_CHARS ) |
Wikitext highlighting when $wgAdvancedSearchHighlighting = true.
string | $text | |
string[] | $terms | Terms to highlight (not html escaped but regex escaped via SearchDatabase::regexTerm()) |
int | $contextlines | |
int | $contextchars |
Definition at line 61 of file SearchHighlighter.php.
|
protected |
Definition at line 39 of file SearchHighlighter.php.
const SearchHighlighter::DEFAULT_CONTEXT_CHARS = 75 |
Definition at line 37 of file SearchHighlighter.php.
Referenced by SearchEngine\userHighlightPrefs().
const SearchHighlighter::DEFAULT_CONTEXT_LINES = 2 |
Definition at line 36 of file SearchHighlighter.php.
Referenced by SearchEngine\userHighlightPrefs().