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>',
29 $user->setName(
"127.0.0.1" );
31 $text = $wgParser->preSaveTransform( $text,
$title,
$user, $popts );
33 $this->assertEquals( $expected, $text );
46 "<p class='foo'>Text.</p>",
47 "<p class='foo'>Text.</p>",
54 "<p>Text.</p><p>More text.</p>",
55 "<p>Text.</p><p>More text.</p>",
82 $wgParser->setHook(
'recursivecallparser', [ $this,
'helperParserFunc' ] );
83 $wgParser->parse(
'<recursivecallparser>baz</recursivecallparser>',
$title, $po );
102 $frame = $wgParser->getPreprocessor()->newFrame();
103 $ret = $wgParser->callParserFunction( $frame,
'#tag',
104 [
'pre',
'foo',
'style' =>
'margin-left: 1.6em' ]
106 $ret[
'text'] = $wgParser->mStripState->unstripBoth(
$ret[
'text'] );
109 'text' =>
'<pre style="margin-left: 1.6em">foo</pre>',
110 ],
$ret,
'callParserFunction works for {{#tag:pre|foo|style=margin-left: 1.6em}}' );
129 'fromtitle' =>
$title->getPrefixedDBkey(),
139 'fromtitle' =>
false,
140 'byteoffset' => null,
149 'fromtitle' =>
$title->getPrefixedDBkey(),
153 ],
$out->getSections(),
'getSections() with proper value when <h2> is used' );
168 'Escaping of unsafe characters',
169 'http://example.org/foo bar?param[]="value"¶m[]=valüe',
170 'http://example.org/foo%20bar?param%5B%5D=%22value%22¶m%5B%5D=val%C3%BCe',
173 'Case normalization of percent-encoded characters',
174 'http://example.org/%ab%cD%Ef%FF',
175 'http://example.org/%AB%CD%EF%FF',
178 'Unescaping of safe characters',
179 'http://example.org/%3C%66%6f%6F%3E?%3C%66%6f%6F%3E#%3C%66%6f%6F%3E',
180 'http://example.org/%3Cfoo%3E?%3Cfoo%3E#%3Cfoo%3E',
183 'Context-sensitive replacement of sometimes-safe characters',
184 'http://example.org/%23%2F%3F%26%3D%2B%3B?%23%2F%3F%26%3D%2B%3B#%23%2F%3F%26%3D%2B%3B',
185 'http://example.org/%23%2F%3F&=+;?%23/?%26%3D%2B%3B#%23/?&=+;',
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
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
Set options of the Parser.
static providePreSaveTransform()
static newFromText($text, $defaultNamespace=NS_MAIN)
Create a new Title from text, such as what one would find in a link.
when a variable name is used in a it is silently declared as a new local masking the global
static newFromUser($user)
Get a ParserOptions object from a given user.
static stripOuterParagraph($html)
Strip outer.
testCallParserFunction()
Parser::callParserFunction.
testRecursiveParse()
MWException Parser state cleared while parsing.
namespace and then decline to actually register it file or subcat img or subcat $title
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 local account $user
testNormalizeLinkUrl($explanation, $url, $expected)
provideNormalizeLinkUrl Parser::normalizeLinkUrl Parser::normalizeUrlComponent
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
Variant of the Message class.
helperParserFunc($input, $args, $parser)
testGetSections()
Parser::parse ParserOutput::getSections.
static normalizeLinkUrl($url)
Replace unusual escape codes in a URL with their equivalent characters.
testPreSaveTransform($text, $expected)
providePreSaveTransform Parser::preSaveTransform
testStripOuterParagraph($text, $expected)
provideStripOuterParagraph Parser::stripOuterParagraph
static provideStripOuterParagraph()
static provideNormalizeLinkUrl()