Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
98.55% covered (success)
98.55%
68 / 69
85.71% covered (warning)
85.71%
6 / 7
CRAP
0.00% covered (danger)
0.00%
0 / 1
CoreTagHooks
98.55% covered (success)
98.55%
68 / 69
85.71% covered (warning)
85.71%
6 / 7
20
0.00% covered (danger)
0.00%
0 / 1
 register
100.00% covered (success)
100.00%
9 / 9
100.00% covered (success)
100.00%
1 / 1
2
 pre
100.00% covered (success)
100.00%
8 / 8
100.00% covered (success)
100.00%
1 / 1
1
 html
90.00% covered (success)
90.00%
9 / 10
0.00% covered (danger)
0.00%
0 / 1
3.01
 nowiki
100.00% covered (success)
100.00%
9 / 9
100.00% covered (success)
100.00%
1 / 1
1
 gallery
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 indicator
100.00% covered (success)
100.00%
9 / 9
100.00% covered (success)
100.00%
1 / 1
3
 langconvert
100.00% covered (success)
100.00%
23 / 23
100.00% covered (success)
100.00%
1 / 1
9
1<?php
2/**
3 * Tag hooks provided by MediaWiki core
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 * http://www.gnu.org/copyleft/gpl.html
19 *
20 * @file
21 * @ingroup Parser
22 */
23
24use MediaWiki\Config\ServiceOptions;
25use MediaWiki\Html\Html;
26use MediaWiki\MainConfigNames;
27use MediaWiki\MediaWikiServices;
28use MediaWiki\Parser\Parser;
29use MediaWiki\Parser\Sanitizer;
30
31/**
32 * Various tag hooks, registered in every Parser
33 * @ingroup Parser
34 */
35class CoreTagHooks {
36
37    /**
38     * @internal
39     */
40    public const REGISTER_OPTIONS = [
41        // See documentation for the corresponding config options
42        MainConfigNames::RawHtml,
43    ];
44
45    /**
46     * @param Parser $parser
47     * @param ServiceOptions $options
48     *
49     * @return void
50     * @internal
51     */
52    public static function register( Parser $parser, ServiceOptions $options ) {
53        $options->assertRequiredOptions( self::REGISTER_OPTIONS );
54        $rawHtml = $options->get( MainConfigNames::RawHtml );