mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/ParserFunctions
synced 2024-11-24 08:14:28 +00:00
16c50e014e
Bug: T249138 Change-Id: I663c3919e08688354d68ced6945f6eb40265d2ac
57 lines
852 B
Plaintext
57 lines
852 B
Plaintext
!! Version 2
|
|
# Force the test runner to ensure the extension is loaded
|
|
# Use '#switch' to do the detection, since we might not have
|
|
# string functions enabled (yet) -- they are force-enabled on a per-test
|
|
# basis by the ParserTestGlobals hook.
|
|
!! functionhooks
|
|
switch
|
|
!! endfunctionhooks
|
|
|
|
# @todo expand
|
|
|
|
!! test
|
|
#len
|
|
!! wikitext
|
|
{{#len:}}
|
|
{{#len:0}}
|
|
{{#len:test}}
|
|
!! html
|
|
<p>0
|
|
1
|
|
4
|
|
</p>
|
|
!! end
|
|
|
|
!! test
|
|
#urldecode
|
|
!! wikitext
|
|
{{#urldecode:}}
|
|
{{#urldecode:foo%20bar}}
|
|
{{#urldecode:%D0%9C%D0%B5%D0%B4%D0%B8%D0%B0%D0%92%D0%B8%D0%BA%D0%B8}}
|
|
{{#urldecode: some unescaped string}}
|
|
!! html
|
|
<p>foo bar
|
|
МедиаВики
|
|
some unescaped string
|
|
</p>
|
|
!! end
|
|
|
|
!! test
|
|
#pos
|
|
!! wikitext
|
|
{{#pos:Žmržlina|žlina}}
|
|
{{#pos:stringstring|str|4}}
|
|
!! html
|
|
<p>3
|
|
6
|
|
</p>
|
|
!! end
|
|
|
|
!! test
|
|
#pos with too large offset (T209600)
|
|
!! wikitext
|
|
{{#pos:FooBar|Foo|32}}
|
|
!! html
|
|
|
|
!! end
|