|
MediaWiki master
|
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 | |
| bool | $mCleanWikitext = true |
Highlight bits of wikitext.
Definition at line 23 of file SearchHighlighter.php.
| SearchHighlighter::__construct | ( | $cleanupWikitext = true | ) |
| bool | $cleanupWikitext |
Definition at line 36 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 572 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 520 of file SearchHighlighter.php.
| 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 50 of file SearchHighlighter.php.
|
protected |
Definition at line 28 of file SearchHighlighter.php.
| const SearchHighlighter::DEFAULT_CONTEXT_CHARS = 75 |
Definition at line 25 of file SearchHighlighter.php.
Referenced by SearchEngine\userHighlightPrefs().
| const SearchHighlighter::DEFAULT_CONTEXT_LINES = 2 |
Definition at line 24 of file SearchHighlighter.php.
Referenced by SearchEngine\userHighlightPrefs().