Go to the documentation of this file.
11 [
'hello this is ~~~',
12 "hello this is [[Special:Contributions/127.0.0.1|127.0.0.1]]",
14 [
'hello \'\'this\'\' is <nowiki>~~~</nowiki>',
15 'hello \'\'this\'\' is <nowiki>~~~</nowiki>',
28 $user->setName(
"127.0.0.1" );
32 $this->assertEquals( $expected, $text );
45 "<p class='foo'>Text.</p>",
46 "<p class='foo'>Text.</p>",
53 "<p>Text.</p><p>More text.</p>",
54 "<p>Text.</p><p>More text.</p>",
67 $this->assertEquals( $expected, Parser::stripOuterParagraph( $text ) );
79 $wgParser->setHook(
'recursivecallparser', [ $this,
'helperParserFunc' ] );
80 $wgParser->parse(
'<recursivecallparser>baz</recursivecallparser>',
$title, $po );
96 $frame =
$wgParser->getPreprocessor()->newFrame();
98 [
'pre',
'foo',
'style' =>
'margin-left: 1.6em' ]
103 'text' =>
'<pre style="margin-left: 1.6em">foo</pre>',
104 ],
$ret,
'callParserFunction works for {{#tag:pre|foo|style=margin-left: 1.6em}}' );
123 'fromtitle' =>
$title->getPrefixedDBkey(),
133 'fromtitle' =>
false,
134 'byteoffset' =>
null,
143 'fromtitle' =>
$title->getPrefixedDBkey(),
147 ],
$out->getSections(),
'getSections() with proper value when <h2> is used' );
154 $this->assertEquals( $expected, Parser::normalizeLinkUrl( $url ), $explanation );
160 'Escaping of unsafe characters',
161 'http://example.org/foo bar?param[]="value"¶m[]=valüe',
162 'http://example.org/foo%20bar?param%5B%5D=%22value%22¶m%5B%5D=val%C3%BCe',
165 'Case normalization of percent-encoded characters',
166 'http://example.org/%ab%cD%Ef%FF',
167 'http://example.org/%AB%CD%EF%FF',
170 'Unescaping of safe characters',
171 'http://example.org/%3C%66%6f%6F%3E?%3C%66%6f%6F%3E#%3C%66%6f%6F%3E',
172 'http://example.org/%3Cfoo%3E?%3Cfoo%3E#%3Cfoo%3E',
175 'Context-sensitive replacement of sometimes-safe characters',
176 'http://example.org/%23%2F%3F%26%3D%2B%3B?%23%2F%3F%26%3D%2B%3B#%23%2F%3F%26%3D%2B%3B',
177 'http://example.org/%23%2F%3F&=+;?%23/?%26%3D%2B%3B#%23/?&=+;',
Set options of the Parser.
please add to it if you re going to add events to the MediaWiki code where normally authentication against an external auth plugin would be creating a account $user
static newFromText( $text, $defaultNamespace=NS_MAIN)
Create a new Title from text, such as what one would find in a link.
helperParserFunc( $input, $args, $parser)
testNormalizeLinkUrl( $explanation, $url, $expected)
provideNormalizeLinkUrl
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
static providePreSaveTransform()
namespace and then decline to actually register it file or subcat img or subcat $title
if(is_array( $mode)) switch( $mode) $input
testRecursiveParse()
MWException Parser state cleared while parsing.
testPreSaveTransform( $text, $expected)
providePreSaveTransform
do that in ParserLimitReportFormat instead $parser
when a variable name is used in a it is silently declared as a new masking the global
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses & $ret
testStripOuterParagraph( $text, $expected)
provideStripOuterParagraph
static provideStripOuterParagraph()
static provideNormalizeLinkUrl()
testGetSections()
Parser ParserOutput::getSections.
Variant of the Message class.
static newFromUser( $user)
Get a ParserOptions object from a given user.
this hook is for auditing only or null if authentication failed before getting that far or null if we can t even determine that probably a stub it is not rendered in wiki pages or galleries in category pages allow injecting custom HTML after the section Any uses of the hook need to handle escaping see BaseTemplate::getToolbox and BaseTemplate::makeListItem for details on the format of individual items inside of this array or by returning and letting standard HTTP rendering take place modifiable or by returning false and taking over the output $out