Merge "Refactor ContributionsSpecialPage->contributionsSub to support markup overrides"
[mediawiki.git] / includes / api / Hook / ApiFormatHighlightHook.php
bloba14e232c298206acfc474ec0654cf9730a764f62
1 <?php
3 namespace MediaWiki\Api\Hook;
5 use MediaWiki\Context\IContextSource;
7 /**
8 * This is a hook handler interface, see docs/Hooks.md.
9 * Use the hook name "ApiFormatHighlight" to register handlers implementing this interface.
11 * @stable to implement
12 * @ingroup Hooks
14 interface ApiFormatHighlightHook {
15 /**
16 * Use this hook to syntax-highlight API pretty-printed output.
18 * @since 1.35
20 * @param IContextSource $context
21 * @param string $text Text to be highlighted
22 * @param string $mime MIME type of $text
23 * @param string $format API format code for $text
24 * @return bool|void True or no return value to continue, or false and add output
25 * to $context->getOutput() to highlight
27 public function onApiFormatHighlight( $context, $text, $mime, $format );