|
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 25 of file SearchHighlighter.php.
| MediaWiki\Search\SearchHighlighter::__construct | ( | $cleanupWikitext = true | ) |
| bool | $cleanupWikitext |
Definition at line 38 of file SearchHighlighter.php.
| MediaWiki\Search\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 574 of file SearchHighlighter.php.
| MediaWiki\Search\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 522 of file SearchHighlighter.php.
References MediaWiki\MediaWikiServices\getInstance().
| MediaWiki\Search\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 52 of file SearchHighlighter.php.
References $matches, MediaWiki\MediaWikiServices\getInstance(), NS_FILE, and MediaWiki\MainConfigNames\SearchHighlightBoundaries.
|
protected |
Definition at line 30 of file SearchHighlighter.php.
| const MediaWiki\Search\SearchHighlighter::DEFAULT_CONTEXT_CHARS = 75 |
Definition at line 27 of file SearchHighlighter.php.
Referenced by MediaWiki\Search\SearchEngine\userHighlightPrefs().
| const MediaWiki\Search\SearchHighlighter::DEFAULT_CONTEXT_LINES = 2 |
Definition at line 26 of file SearchHighlighter.php.
Referenced by MediaWiki\Search\SearchEngine\userHighlightPrefs().