Debian Codegraph @

tests/parser/magicWords.txt

raw
1 # The parsoid-compatible option below is only relevant when we are running
2 # parser tests in integrated mode with Parsoid. This option is ignored
3 # when this test file is run with Parsoid in standalone mode.
4 !! options
5 parsoid-compatible=wt2html,wt2wt
6 version=2
7 !! end
8
9 # Note that the current date is hard-coded as
10 # 1970-01-01T00:02:03Z (a Thursday)
11 # when running parser tests. The timezone is also fixed to GMT, so
12 # local date will be identical to current date.
13
14 !! test
15 Magic Word: {{CURRENTDAY}}
16 !! wikitext
17 {{CURRENTDAY}}
18 !! html/php
19 <p>1
20 </p>
21 !! html/parsoid+integrated
22 <p><span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"CURRENTDAY","function":"currentday"},"params":{},"i":0}}]}'>1</span></p>
23 !! end
24
25 !! test
26 Magic Word: {{CURRENTDAY2}}
27 !! wikitext
28 {{CURRENTDAY2}}
29 !! html/php
30 <p>01
31 </p>
32 !! html/parsoid+integrated
33 <p><span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"CURRENTDAY2","function":"currentday2"},"params":{},"i":0}}]}'>01</span></p>
34 !! end
35
36 !! test
37 Magic Word: {{CURRENTDAYNAME}}
38 !! wikitext
39 {{CURRENTDAYNAME}}
40 !! html/php
41 <p>Thursday
42 </p>
43 !! html/parsoid+integrated
44 <p><span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"CURRENTDAYNAME","function":"currentdayname"},"params":{},"i":0}}]}'>Thursday</span></p>
45 !! end
46
47 !! test
48 Magic Word: {{CURRENTDOW}}
49 !! wikitext
50 {{CURRENTDOW}}
51 !! html/php
52 <p>4
53 </p>
54 !! html/parsoid+integrated
55 <p><span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"CURRENTDOW","function":"currentdow"},"params":{},"i":0}}]}'>4</span></p>
56 !! end
57
58 !! test
59 Magic Word: {{CURRENTMONTH}}
60 !! wikitext
61 {{CURRENTMONTH}}
62 !! html/php
63 <p>01
64 </p>
65 !! html/parsoid+integrated
66 <p><span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"CURRENTMONTH","function":"currentmonth"},"params":{},"i":0}}]}'>01</span></p>
67 !! end
68
69 !! test
70 Magic Word: {{CURRENTMONTH1}}
71 !! wikitext
72 {{CURRENTMONTH1}}
73 !! html/php
74 <p>1
75 </p>
76 !! html/parsoid+integrated
77 <p><span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"CURRENTMONTH1","function":"currentmonth1"},"params":{},"i":0}}]}'>1</span></p>
78 !! end
79
80 !! test
81 Magic Word: {{CURRENTMONTHABBREV}}
82 !! wikitext
83 {{CURRENTMONTHABBREV}}
84 !! html/php
85 <p>Jan
86 </p>
87 !! html/parsoid+integrated
88 <p><span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"CURRENTMONTHABBREV","function":"currentmonthabbrev"},"params":{},"i":0}}]}'>Jan</span></p>
89 !! end
90
91 !! test
92 Magic Word: {{CURRENTMONTHNAME}}
93 !! wikitext
94 {{CURRENTMONTHNAME}}
95 !! html/php
96 <p>January
97 </p>
98 !! html/parsoid+integrated
99 <p><span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"CURRENTMONTHNAME","function":"currentmonthname"},"params":{},"i":0}}]}'>January</span></p>
100 !! end
101
102 !! test
103 Magic Word: {{CURRENTMONTHNAMEGEN}}
104 !! wikitext
105 {{CURRENTMONTHNAMEGEN}}
106 !! html/php
107 <p>January
108 </p>
109 !! html/parsoid+integrated
110 <p><span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"CURRENTMONTHNAMEGEN","function":"currentmonthnamegen"},"params":{},"i":0}}]}'>January</span></p>
111 !! end
112
113 !! test
114 Magic Word: {{CURRENTTIME}}
115 !! wikitext
116 {{CURRENTTIME}}
117 !! html/php
118 <p>00:02
119 </p>
120 !! html/parsoid+integrated
121 <p><span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"CURRENTTIME","function":"currenttime"},"params":{},"i":0}}]}'>00:02</span></p>
122 !! end
123
124 !! test
125 Magic Word: {{CURRENTHOUR}}
126 !! wikitext
127 {{CURRENTHOUR}}
128 !! html/php
129 <p>00
130 </p>
131 !! html/parsoid+integrated
132 <p><span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"CURRENTHOUR","function":"currenthour"},"params":{},"i":0}}]}'>00</span></p>
133 !! end
134
135 !! test
136 Magic Word: {{CURRENTWEEK}} (T6594)
137 !! wikitext
138 {{CURRENTWEEK}}
139 !! html/php
140 <p>1
141 </p>
142 !! html/parsoid+integrated
143 <p><span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"CURRENTWEEK","function":"currentweek"},"params":{},"i":0}}]}'>1</span></p>
144 !! end
145
146 !! test
147 Magic Word: {{CURRENTYEAR}}
148 !! wikitext
149 {{CURRENTYEAR}}
150 !! html/php
151 <p>1970
152 </p>
153 !! html/parsoid+integrated
154 <p><span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"CURRENTYEAR","function":"currentyear"},"params":{},"i":0}}]}'>1970</span></p>
155 !! end
156
157 !! test
158 Magic Word: {{CURRENTTIMESTAMP}}
159 !! wikitext
160 {{CURRENTTIMESTAMP}}
161 !! html/php
162 <p>19700101000203
163 </p>
164 !! html/parsoid+integrated
165 <p><span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"CURRENTTIMESTAMP","function":"currenttimestamp"},"params":{},"i":0}}]}'>19700101000203</span></p>
166 !! end
167
168 !! test
169 Magic Words LOCAL (UTC)
170 !! wikitext
171 *{{LOCALMONTH}}
172 *{{LOCALMONTH1}}
173 *{{LOCALMONTHNAME}}
174 *{{LOCALMONTHNAMEGEN}}
175 *{{LOCALMONTHABBREV}}
176 *{{LOCALDAY}}
177 *{{LOCALDAY2}}
178 *{{LOCALDAYNAME}}
179 *{{LOCALYEAR}}
180 *{{LOCALTIME}}
181 *{{LOCALHOUR}}
182 *{{LOCALWEEK}}
183 *{{LOCALDOW}}
184 *{{LOCALTIMESTAMP}}
185 !! html/php
186 <ul><li>01</li>
187 <li>1</li>
188 <li>January</li>
189 <li>January</li>
190 <li>Jan</li>
191 <li>1</li>
192 <li>01</li>
193 <li>Thursday</li>
194 <li>1970</li>
195 <li>00:02</li>
196 <li>00</li>
197 <li>1</li>
198 <li>4</li>
199 <li>19700101000203</li></ul>
200 !! html/parsoid+integrated
201 <ul><li><span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"LOCALMONTH","function":"localmonth"},"params":{},"i":0}}]}'>01</span></li>
202 <li><span about="#mwt2" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"LOCALMONTH1","function":"localmonth1"},"params":{},"i":0}}]}'>1</span></li>
203 <li><span about="#mwt3" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"LOCALMONTHNAME","function":"localmonthname"},"params":{},"i":0}}]}'>January</span></li>
204 <li><span about="#mwt4" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"LOCALMONTHNAMEGEN","function":"localmonthnamegen"},"params":{},"i":0}}]}'>January</span></li>
205 <li><span about="#mwt5" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"LOCALMONTHABBREV","function":"localmonthabbrev"},"params":{},"i":0}}]}'>Jan</span></li>
206 <li><span about="#mwt6" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"LOCALDAY","function":"localday"},"params":{},"i":0}}]}'>1</span></li>
207 <li><span about="#mwt7" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"LOCALDAY2","function":"localday2"},"params":{},"i":0}}]}'>01</span></li>
208 <li><span about="#mwt8" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"LOCALDAYNAME","function":"localdayname"},"params":{},"i":0}}]}'>Thursday</span></li>
209 <li><span about="#mwt9" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"LOCALYEAR","function":"localyear"},"params":{},"i":0}}]}'>1970</span></li>
210 <li><span about="#mwt10" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"LOCALTIME","function":"localtime"},"params":{},"i":0}}]}'>00:02</span></li>
211 <li><span about="#mwt11" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"LOCALHOUR","function":"localhour"},"params":{},"i":0}}]}'>00</span></li>
212 <li><span about="#mwt12" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"LOCALWEEK","function":"localweek"},"params":{},"i":0}}]}'>1</span></li>
213 <li><span about="#mwt13" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"LOCALDOW","function":"localdow"},"params":{},"i":0}}]}'>4</span></li>
214 <li><span about="#mwt14" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"LOCALTIMESTAMP","function":"localtimestamp"},"params":{},"i":0}}]}'>19700101000203</span></li></ul>
215 !! end
216
217 !! test
218 Magic Word: {{FULLPAGENAME}}
219 !! options
220 title=[[User:Ævar Arnfjörð Bjarmason]]
221 parsoid={ "modes": ["wt2html","wt2wt"] }
222 !! wikitext
223 {{FULLPAGENAME}}
224 !! html/php
225 <p>User:Ævar Arnfjörð Bjarmason
226 </p>
227 !! html/parsoid+integrated
228 <p><span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"FULLPAGENAME","function":"fullpagename"},"params":{},"i":0}}]}'>User:Ævar Arnfjörð Bjarmason</span></p>
229 !! end
230
231 !! test
232 Magic Word: {{FULLPAGENAMEE}}
233 !! options
234 title=[[User:Ævar Arnfjörð Bjarmason]]
235 parsoid={ "modes": ["wt2html","wt2wt"] }
236 !! wikitext
237 {{FULLPAGENAMEE}}
238 !! html/php
239 <p>User:%C3%86var_Arnfj%C3%B6r%C3%B0_Bjarmason
240 </p>
241 !! html/parsoid+integrated
242 <p><span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"FULLPAGENAMEE","function":"fullpagenamee"},"params":{},"i":0}}]}'>User:%C3%86var_Arnfj%C3%B6r%C3%B0_Bjarmason</span></p>
243 !! end
244
245 !! test
246 Magic Word: {{TALKSPACE}}
247 !! options
248 title=[[User:Ævar Arnfjörð Bjarmason]]
249 parsoid={ "modes": ["wt2html","wt2wt"] }
250 !! wikitext
251 {{TALKSPACE}}
252 !! html/php
253 <p>User talk
254 </p>
255 !! html/parsoid+integrated
256 <p><span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"TALKSPACE","function":"talkspace"},"params":{},"i":0}}]}'>User talk</span></p>
257 !! end
258
259 !! test
260 Magic Word: {{TALKSPACE}}, same namespace
261 !! options
262 title=[[User talk:Ævar Arnfjörð Bjarmason]]
263 parsoid={ "modes": ["wt2html","wt2wt"] }
264 !! wikitext
265 {{TALKSPACE}}
266 !! html/php
267 <p>User talk
268 </p>
269 !! html/parsoid+integrated
270 <p><span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"TALKSPACE","function":"talkspace"},"params":{},"i":0}}]}'>User talk</span></p>
271 !! end
272
273 !! test
274 Magic Word: {{TALKSPACE}}, main namespace
275 !! options
276 title=[[Parser Test]]
277 parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true }
278 !! wikitext
279 {{TALKSPACE}}
280 !! html/php
281 <p>Talk
282 </p>
283 !! html/parsoid+integrated
284 <p><span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"TALKSPACE","function":"talkspace"},"params":{},"i":0}}]}'>Talk</span></p>
285 !! end
286
287 !! test
288 Magic Word: {{TALKSPACEE}}
289 !! options
290 title=[[User:Ævar Arnfjörð Bjarmason]]
291 parsoid={ "modes": ["wt2html","wt2wt"] }
292 !! wikitext
293 {{TALKSPACEE}}
294 !! html/php
295 <p>User_talk
296 </p>
297 !! html/parsoid+integrated
298 <p><span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"TALKSPACEE","function":"talkspacee"},"params":{},"i":0}}]}'>User_talk</span></p>
299 !! end
300
301 !! test
302 Magic Word: {{SUBJECTSPACE}}
303 !! options
304 title=[[User talk:Ævar Arnfjörð Bjarmason]]
305 parsoid={ "modes": ["wt2html","wt2wt"] }
306 !! wikitext
307 {{SUBJECTSPACE}}
308 !! html/php
309 <p>User
310 </p>
311 !! html/parsoid+integrated
312 <p><span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"SUBJECTSPACE","function":"subjectspace"},"params":{},"i":0}}]}'>User</span></p>
313 !! end
314
315 !! test
316 Magic Word: {{SUBJECTSPACE}}, same namespace
317 !! options
318 title=[[User:Ævar Arnfjörð Bjarmason]]
319 parsoid={ "modes": ["wt2html","wt2wt"] }
320 !! wikitext
321 {{SUBJECTSPACE}}
322 !! html/php
323 <p>User
324 </p>
325 !! html/parsoid+integrated
326 <p><span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"SUBJECTSPACE","function":"subjectspace"},"params":{},"i":0}}]}'>User</span></p>
327 !! end
328
329 !! test
330 Magic Word: {{SUBJECTSPACE}}, main namespace
331 !! options
332 title=[[Parser Test]]
333 parsoid={ "modes": ["wt2html","wt2wt"] }
334 !! wikitext
335 {{SUBJECTSPACE}}
336 !! html/php
337 !! html/parsoid+integrated
338 <span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"SUBJECTSPACE","function":"subjectspace"},"params":{},"i":0}}]}'></span>
339 !! end
340
341 !! test
342 Magic Word: {{SUBJECTSPACEE}}
343 !! options
344 title=[[User talk:Ævar Arnfjörð Bjarmason]]
345 parsoid={ "modes": ["wt2html","wt2wt"] }
346 !! wikitext
347 {{SUBJECTSPACEE}}
348 !! html/php
349 <p>User
350 </p>
351 !! html/parsoid+integrated
352 <p><span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"SUBJECTSPACEE","function":"subjectspacee"},"params":{},"i":0}}]}'>User</span></p>
353 !! end
354
355 !! test
356 Magic Word: {{NAMESPACE}}
357 !! options
358 title=[[User:Ævar Arnfjörð Bjarmason]]
359 parsoid={ "modes": ["wt2html","wt2wt"] }
360 !! wikitext
361 {{NAMESPACE}}
362 !! html/php
363 <p>User
364 </p>
365 !! html/parsoid+integrated
366 <p><span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"NAMESPACE","function":"namespace"},"params":{},"i":0}}]}'>User</span></p>
367 !! end
368
369 !! test
370 Magic Word: {{NAMESPACEE}}
371 !! options
372 title=[[User:Ævar Arnfjörð Bjarmason]]
373 parsoid={ "modes": ["wt2html","wt2wt"] }
374 !! wikitext
375 {{NAMESPACEE}}
376 !! html/php
377 <p>User
378 </p>
379 !! html/parsoid+integrated
380 <p><span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"NAMESPACEE","function":"namespacee"},"params":{},"i":0}}]}'>User</span></p>
381 !! end
382
383 !! test
384 Magic Word: {{NAMESPACENUMBER}}
385 !! options
386 title=[[User:Ævar Arnfjörð Bjarmason]]
387 parsoid={ "modes": ["wt2html","wt2wt"] }
388 !! wikitext
389 {{NAMESPACENUMBER}}
390 !! html/php
391 <p>2
392 </p>
393 !! html/parsoid+integrated
394 <p><span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"NAMESPACENUMBER","function":"namespacenumber"},"params":{},"i":0}}]}'>2</span></p>
395 !! end
396
397 !! test
398 Magic Word: {{SUBPAGENAME}}
399 !! options
400 title=[[Ævar Arnfjörð Bjarmason/sub ö]] subpage
401 parsoid={ "modes": ["wt2html","wt2wt"] }
402 !! wikitext
403 {{SUBPAGENAME}}
404 !! html/php
405 <p>sub ö
406 </p>
407 !! html/parsoid+integrated
408 <p><span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"SUBPAGENAME","function":"subpagename"},"params":{},"i":0}}]}'>sub ö</span></p>
409 !! end
410
411 !! test
412 Magic Word: {{SUBPAGENAMEE}}
413 !! options
414 title=[[Ævar Arnfjörð Bjarmason/sub ö]] subpage
415 parsoid={ "modes": ["wt2html","wt2wt"] }
416 !! wikitext
417 {{SUBPAGENAMEE}}
418 !! html/php
419 <p>sub_%C3%B6
420 </p>
421 !! html/parsoid+integrated
422 <p><span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"SUBPAGENAMEE","function":"subpagenamee"},"params":{},"i":0}}]}'>sub_%C3%B6</span></p>
423 !! end
424
425 !! test
426 Magic Word: {{ROOTPAGENAME}}
427 !! options
428 title=[[Ævar Arnfjörð Bjarmason/sub/sub2]] subpage
429 parsoid={ "modes": ["wt2html","wt2wt"] }
430 !! wikitext
431 {{ROOTPAGENAME}}
432 !! html/php
433 <p>Ævar Arnfjörð Bjarmason
434 </p>
435 !! html/parsoid+integrated
436 <p><span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"ROOTPAGENAME","function":"rootpagename"},"params":{},"i":0}}]}'>Ævar Arnfjörð Bjarmason</span></p>
437 !! end
438
439 !! test
440 Magic Word: {{ROOTPAGENAMEE}}
441 !! options
442 title=[[Ævar Arnfjörð Bjarmason/sub/sub2]] subpage
443 parsoid={ "modes": ["wt2html","wt2wt"] }
444 !! wikitext
445 {{ROOTPAGENAMEE}}
446 !! html/php
447 <p>%C3%86var_Arnfj%C3%B6r%C3%B0_Bjarmason
448 </p>
449 !! html/parsoid+integrated
450 <p><span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"ROOTPAGENAMEE","function":"rootpagenamee"},"params":{},"i":0}}]}'>%C3%86var_Arnfj%C3%B6r%C3%B0_Bjarmason</span></p>
451 !! end
452
453 !! test
454 Magic Word: {{BASEPAGENAME}}
455 !! options
456 title=[[Ævar Arnfjörð Bjarmason/sub]] subpage
457 parsoid={ "modes": ["wt2html","wt2wt"] }
458 !! wikitext
459 {{BASEPAGENAME}}
460 !! html/php
461 <p>Ævar Arnfjörð Bjarmason
462 </p>
463 !! html/parsoid+integrated
464 <p><span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"BASEPAGENAME","function":"basepagename"},"params":{},"i":0}}]}'>Ævar Arnfjörð Bjarmason</span></p>
465 !! end
466
467 !! test
468 Magic Word: {{BASEPAGENAMEE}}
469 !! options
470 title=[[Ævar Arnfjörð Bjarmason/sub]] subpage
471 parsoid={ "modes": ["wt2html","wt2wt"] }
472 !! wikitext
473 {{BASEPAGENAMEE}}
474 !! html/php
475 <p>%C3%86var_Arnfj%C3%B6r%C3%B0_Bjarmason
476 </p>
477 !! html/parsoid+integrated
478 <p><span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"BASEPAGENAMEE","function":"basepagenamee"},"params":{},"i":0}}]}'>%C3%86var_Arnfj%C3%B6r%C3%B0_Bjarmason</span></p>
479 !! end
480
481 !! test
482 Magic Word: {{TALKPAGENAME}}
483 !! options
484 title=[[User:Ævar Arnfjörð Bjarmason]]
485 parsoid={ "modes": ["wt2html","wt2wt"] }
486 !! wikitext
487 {{TALKPAGENAME}}
488 !! html/php
489 <p>User talk:Ævar Arnfjörð Bjarmason
490 </p>
491 !! html/parsoid+integrated
492 <p><span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"TALKPAGENAME","function":"talkpagename"},"params":{},"i":0}}]}'>User talk:Ævar Arnfjörð Bjarmason</span></p>
493 !! end
494
495 !! test
496 Magic Word: {{TALKPAGENAMEE}}
497 !! options
498 title=[[User:Ævar Arnfjörð Bjarmason]]
499 parsoid={ "modes": ["wt2html","wt2wt"] }
500 !! wikitext
501 {{TALKPAGENAMEE}}
502 !! html/php
503 <p>User_talk:%C3%86var_Arnfj%C3%B6r%C3%B0_Bjarmason
504 </p>
505 !! html/parsoid+integrated
506 <p><span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"TALKPAGENAMEE","function":"talkpagenamee"},"params":{},"i":0}}]}'>User_talk:%C3%86var_Arnfj%C3%B6r%C3%B0_Bjarmason</span></p>
507 !! end
508
509 !! test
510 Magic Word: {{SUBJECTPAGENAME}}
511 !! options
512 title=[[User talk:Ævar Arnfjörð Bjarmason]]
513 parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true }
514 !! wikitext
515 {{SUBJECTPAGENAME}}
516 !! html/php
517 <p>User:Ævar Arnfjörð Bjarmason
518 </p>
519 !! html/parsoid+integrated
520 <p><span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"SUBJECTPAGENAME","function":"subjectpagename"},"params":{},"i":0}}]}'>User:Ævar Arnfjörð Bjarmason</span></p>
521 !! end
522
523 !! test
524 Magic Word: {{SUBJECTPAGENAMEE}}
525 !! options
526 title=[[User talk:Ævar Arnfjörð Bjarmason]]
527 parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true }
528 !! wikitext
529 {{SUBJECTPAGENAMEE}}
530 !! html/php
531 <p>User:%C3%86var_Arnfj%C3%B6r%C3%B0_Bjarmason
532 </p>
533 !! html/parsoid+integrated
534 <p><span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"SUBJECTPAGENAMEE","function":"subjectpagenamee"},"params":{},"i":0}}]}'>User:%C3%86var_Arnfj%C3%B6r%C3%B0_Bjarmason</span></p>
535 !! end
536
537 !! test
538 Magic Word: {{NUMBEROFFILES}}
539 !! options
540 parsoid={ "modes": ["wt2html","wt2wt"] }
541 !! wikitext
542 {{NUMBEROFFILES}}
543 !! html/php
544 <p>8
545 </p>
546 !! html/parsoid+integrated
547 <p><span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"NUMBEROFFILES","function":"numberoffiles"},"params":{},"i":0}}]}'>8</span></p>
548 !! end
549
550 !! test
551 Magic Word: {{PAGENAME}}
552 !! options
553 title=[[User:Ævar Arnfjörð Bjarmason]]
554 parsoid={ "modes": ["wt2html","wt2wt"] }
555 !! wikitext
556 {{PAGENAME}}
557 !! html/php
558 <p>Ævar Arnfjörð Bjarmason
559 </p>
560 !! html/parsoid+integrated
561 <p><span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"PAGENAME","function":"pagename"},"params":{},"i":0}}]}'>Ævar Arnfjörð Bjarmason</span></p>
562 !! end
563
564 !! test
565 Magic Word: {{PAGENAME}} with metacharacters
566 !! options
567 title=[['foo & bar = baz']]
568 parsoid={ "modes": ["wt2html","wt2wt"] }
569 !! wikitext
570 ''{{PAGENAME}}''
571 !! html/php
572 <p><i>&#39;foo &#38; bar &#61; baz&#39;</i>
573 </p>
574 !! html/parsoid+integrated
575 <p><i><span about="#mwt1" typeof="mw:Transclusion mw:Entity" data-mw='{"parts":[{"template":{"target":{"wt":"PAGENAME","function":"pagename"},"params":{},"i":0}}]}'>'</span><span>foo </span><span typeof="mw:Entity">&amp;</span><span> bar </span><span typeof="mw:Entity">=</span><span> baz</span><span typeof="mw:Entity">'</span></i></p>
576 !! end
577
578 !! test
579 Magic Word: {{PAGENAME}} with metacharacters (T28781)
580 !! options
581 title=[[*RFC 1234 http://example.com/]]
582 parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true }
583 !! wikitext
584 {{PAGENAME}}
585 !! html/php
586 <p>&#42;RFC&#32;1234 http&#58;//example.com/
587 </p>
588 !! html/parsoid+integrated
589 <p><span about="#mwt1" typeof="mw:Transclusion mw:Entity" data-mw='{"parts":[{"template":{"target":{"wt":"PAGENAME","function":"pagename"},"params":{},"i":0}}]}'>*</span><span>RFC</span><span typeof="mw:Entity"> </span><span>1234 http</span><span typeof="mw:Entity">:</span><span>//example.com/</span></p>
590 !! end
591
592 !! test
593 Magic Word: {{PAGENAMEE}}
594 !! options
595 title=[[User:Ævar Arnfjörð Bjarmason]]
596 parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true }
597 !! wikitext
598 {{PAGENAMEE}}
599 !! html/php
600 <p>%C3%86var_Arnfj%C3%B6r%C3%B0_Bjarmason
601 </p>
602 !! html/parsoid+integrated
603 <p><span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"PAGENAMEE","function":"pagenamee"},"params":{},"i":0}}]}'>%C3%86var_Arnfj%C3%B6r%C3%B0_Bjarmason</span></p>
604 !! end
605
606 !! test
607 Magic Word: {{PAGENAMEE}} with metacharacters (T28781)
608 !! options
609 title=[[*RFC 1234 http://example.com/]]
610 parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true }
611 !! wikitext
612 {{PAGENAMEE}}
613 !! html/php
614 <p>&#42;RFC_1234_http&#58;//example.com/
615 </p>
616 !! html/parsoid+integrated
617 <p><span typeof="mw:Transclusion mw:Entity" about="#mwt1" data-parsoid='{"srcContent":"*","pi":[[]]}' data-mw='{"parts":[{"template":{"target":{"wt":"PAGENAMEE","function":"pagenamee"},"params":{},"i":0}}]}'>*</span><span about="#mwt1">RFC_1234_http</span><span typeof="mw:Entity" about="#mwt1">:</span><span about="#mwt1">//example.com/</span></p>
618 !! end
619
620 !! test
621 Magic Word: {{REVISIONID}} on latest revision
622 !! options
623 lastsavedrevision
624 parsoid={ "modes": ["wt2html","wt2wt"] }
625 showflags
626 !! wikitext
627 {{REVISIONID}}
628 !! metadata/integrated
629 flags=vary-revision-id
630 !! html/php
631 <p>1337
632 </p>
633 !! html/parsoid+integrated
634 <p><span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"REVISIONID","function":"revisionid"},"params":{},"i":0}}]}'>1337</span></p>
635 !! end
636
637 !! test
638 Magic Word: {{REVISIONID}} on non-latest revision
639 !! options
640 parsoid={ "modes": ["wt2html","wt2wt"] }
641 showflags
642 !! wikitext
643 {{REVISIONID}}
644 !! metadata/integrated
645 flags=vary-revision-id
646 !! html/php
647 <p>1337
648 </p>
649 !! html/parsoid+integrated
650 <p><span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"REVISIONID","function":"revisionid"},"params":{},"i":0}}]}'>1337</span></p>
651 !! end
652
653 !! test
654 Magic Word: {{REVISIONTIMESTAMP}} on latest revision
655 !! options
656 lastsavedrevision
657 parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true }
658 showflags
659 !! wikitext
660 {{REVISIONTIMESTAMP}}
661 !! metadata/integrated
662 flags=
663 !! html/php
664 <p>19700101000203
665 </p>
666 !! html/parsoid+integrated
667 <p><span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"REVISIONTIMESTAMP","function":"revisiontimestamp"},"params":{},"i":0}}]}'>19700101000203</span></p>
668 !! end
669
670 !! test
671 Magic Word: {{REVISIONTIMESTAMP:{{PAGENAME}}}} on latest revision
672 !! options
673 lastsavedrevision
674 parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true }
675 showflags
676 !! wikitext
677 {{REVISIONTIMESTAMP:{{PAGENAME}}}}
678 !! metadata/integrated
679 flags=
680 !! html/php
681 <p>19700101000203
682 </p>
683 !! html/parsoid+integrated
684 <p><span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"REVISIONTIMESTAMP:{{PAGENAME}}","function":"revisiontimestamp"},"params":{},"i":0}}]}'>19700101000203</span></p>
685 !! end
686
687 !! test
688 Magic Word: {{REVISIONTIMESTAMP}} on not-yet-existing current page
689 !! options
690 title=[[This page does not exist]]
691 parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true }
692 showflags
693 !! wikitext
694 {{REVISIONTIMESTAMP}}
695 !! metadata/integrated
696 flags=vary-revision-timestamp
697 !! html/php
698 <p>19700101000203
699 </p>
700 !! html/parsoid+integrated
701 <p><span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"REVISIONTIMESTAMP","function":"revisiontimestamp"},"params":{},"i":0}}]}'>19700101000203</span></p>
702 !! end
703
704 !! test
705 Magic Word: {{REVISIONTIMESTAMP:{{PAGENAME}}}} on not-yet-existing current page
706 !! options
707 title=[[This page does not exist]]
708 parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true }
709 showflags
710 !! wikitext
711 {{REVISIONTIMESTAMP:{{PAGENAME}}}}
712 !! metadata/integrated
713 flags=vary-revision-timestamp
714 !! html/php
715 <p>19700101000203
716 </p>
717 !! html/parsoid+integrated
718 <p><span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"REVISIONTIMESTAMP:{{PAGENAME}}","function":"revisiontimestamp"},"params":{},"i":0}}]}'>19700101000203</span></p>
719 !! end
720
721 !! test
722 Magic Word: {{REVISIONTIMESTAMP:...}}} on non-existing non-current page
723 !! options
724 parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true }
725 showflags
726 !! wikitext
727 {{REVISIONTIMESTAMP:This page does not exist}}
728 !! metadata/integrated
729 flags=
730 !! html/php
731 !! html/parsoid+integrated
732 <span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"REVISIONTIMESTAMP:This page does not exist","function":"revisiontimestamp"},"params":{},"i":0}}]}'></span>
733 !! end
734
735 !! test
736 Magic Word: {{REVISIONUSER}} on latest revision
737 !! options
738 lastsavedrevision
739 parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true }
740 showflags
741 !! wikitext
742 {{REVISIONUSER}}
743 !! metadata/integrated
744 flags=vary-user
745 !! html/php
746 <p>127.0.0.1
747 </p>
748 !! html/parsoid+integrated
749 <p><span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"REVISIONUSER","function":"revisionuser"},"params":{},"i":0}}]}'>127.0.0.1</span></p>
750 !! end
751
752 !! test
753 Magic Word: {{REVISIONUSER}} on not-yet-existing current page
754 !! options
755 title=[[This page does not exist]]
756 parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true }
757 showflags
758 !! wikitext
759 {{REVISIONUSER}}
760 !! metadata/integrated
761 flags=vary-user
762 !! html/php
763 !! html/parsoid+integrated
764 <span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"REVISIONUSER","function":"revisionuser"},"params":{},"i":0}}]}'></span>
765 !! end
766
767 !! test
768 Magic Word: {{REVISIONUSER:{{PAGENAME}}}} on not-yet-existing current page
769 !! options
770 title=[[This page does not exist]]
771 parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true }
772 showflags
773 !! wikitext
774 {{REVISIONUSER:{{PAGENAME}}}}
775 !! metadata/integrated
776 flags=vary-user
777 !! html/php
778 !! html/parsoid+integrated
779 <span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"REVISIONUSER:{{PAGENAME}}","function":"revisionuser"},"params":{},"i":0}}]}'></span>
780 !! end
781
782 !! test
783 Magic Word: {{REVISIONUSER:...}} on non-existing non-current page
784 !! options
785 parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true }
786 showflags
787 !! wikitext
788 {{REVISIONUSER:This page does not exist}}
789 !! metadata/integrated
790 flags=
791 !! html/php
792 !! html/parsoid+integrated
793 <span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"REVISIONUSER:This page does not exist","function":"revisionuser"},"params":{},"i":0}}]}'></span>
794 !! end
795
796 !! test
797 Magic Word: {{REVISIONUSER}} on non-latest revision
798 !! options
799 parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true }
800 showflags
801 !! wikitext
802 {{REVISIONUSER}}
803 !! metadata/integrated
804 flags=vary-user
805 !! html/php
806 !! html/parsoid+integrated
807 <span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"REVISIONUSER","function":"revisionuser"},"params":{},"i":0}}]}'></span>
808 !! end
809
810 !! test
811 Parser Function: {{REVISIONID:{{PAGENAME}}}} on latest revision
812 !! options
813 lastsavedrevision
814 parsoid={ "modes": ["wt2html","wt2wt"] }
815 showflags
816 !! wikitext
817 {{REVISIONID:{{PAGENAME}}}}
818 !! metadata/integrated
819 flags=vary-revision-id
820 !! html/php
821 <p>1337
822 </p>
823 !! html/parsoid+integrated
824 <p><span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"REVISIONID:{{PAGENAME}}","function":"revisionid"},"params":{},"i":0}}]}'>1337</span></p>
825 !! end
826
827 !! test
828 Parser Function: {{REVISIONID:{{PAGENAME}}}} on non-saved revision
829 !! options
830 parsoid={ "modes": ["wt2html","wt2wt"] }
831 showflags
832 !! wikitext
833 {{REVISIONID:{{PAGENAME}}}}
834 !! metadata/integrated
835 flags=vary-revision-id
836 !! html/php
837 !! html/parsoid+integrated
838 <span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"REVISIONID:{{PAGENAME}}","function":"revisionid"},"params":{},"i":0}}]}'></span>
839 !! end
840
841 !! test
842 Parser Function: {{REVISIONDAY}} on latest revision
843 !! options
844 lastsavedrevision
845 parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true }
846 showflags
847 !! wikitext
848 {{REVISIONDAY}}
849 !! metadata/integrated
850 flags=
851 !! html/php
852 <p>1
853 </p>
854 !! html/parsoid+integrated
855 <p><span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"REVISIONDAY","function":"revisionday"},"params":{},"i":0}}]}'>1</span></p>
856 !! end
857
858 !! test
859 Parser Function: {{REVISIONDAY:{{PAGENAME}}}} on latest revision
860 !! options
861 lastsavedrevision
862 parsoid={ "modes": ["wt2html","wt2wt"] }
863 showflags
864 !! wikitext
865 {{REVISIONDAY:{{PAGENAME}}}}
866 !! metadata/integrated
867 flags=
868 !! html/php
869 <p>1
870 </p>
871 !! html/parsoid+integrated
872 <p><span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"REVISIONDAY:{{PAGENAME}}","function":"revisionday"},"params":{},"i":0}}]}'>1</span></p>
873 !! end
874
875 !! test
876 Parser Function: {{REVISIONMONTH}} on latest revision
877 !! options
878 lastsavedrevision
879 parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true }
880 showflags
881 !! wikitext
882 {{REVISIONMONTH}}
883 !! metadata/integrated
884 flags=
885 !! html/php
886 <p>01
887 </p>
888 !! html/parsoid+integrated
889 <p><span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"REVISIONMONTH","function":"revisionmonth"},"params":{},"i":0}}]}'>01</span></p>
890 !! end
891
892 !! test
893 Parser Function: {{REVISIONMONTH:{{PAGENAME}}}} on latest revision
894 !! options
895 lastsavedrevision
896 parsoid={ "modes": ["wt2html","wt2wt"] }
897 showflags
898 !! wikitext
899 {{REVISIONMONTH:{{PAGENAME}}}}
900 !! metadata/integrated
901 flags=
902 !! html/php
903 <p>01
904 </p>
905 !! html/parsoid+integrated
906 <p><span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"REVISIONMONTH:{{PAGENAME}}","function":"revisionmonth"},"params":{},"i":0}}]}'>01</span></p>
907 !! end
908
909 !! test
910 Parser Function: {{REVISIONYEAR:{{PAGENAME}}}} on latest revision
911 !! options
912 lastsavedrevision
913 parsoid={ "modes": ["wt2html","wt2wt"] }
914 showflags
915 !! wikitext
916 {{REVISIONYEAR:{{PAGENAME}}}}
917 !! metadata/integrated
918 flags=
919 !! html/php
920 <p>1970
921 </p>
922 !! html/parsoid+integrated
923 <p><span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"REVISIONYEAR:{{PAGENAME}}","function":"revisionyear"},"params":{},"i":0}}]}'>1970</span></p>
924 !! end
925
926 !! test
927 Parser Function: {{PAGESIZE:{{PAGENAME}}}} on latest revision
928 !! options
929 lastsavedrevision
930 parsoid={ "modes": ["wt2html","wt2wt"] }
931 showflags
932 !! wikitext
933 {{PAGESIZE:{{PAGENAME}}}}
934 !! metadata/integrated
935 flags=vary-revision-sha1
936 !! html/php
937 <p>25
938 </p>
939 !! html/parsoid+integrated
940 <p><span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"PAGESIZE:{{PAGENAME}}","function":"pagesize"},"params":{},"i":0}}]}'>25</span></p>
941 !! end
942
943 !! test
944 Parser functions with interwiki titles (T355706)
945 !! wikitext
946 * {{PAGEID:Parser test}} - {{PAGEID:wikipedia:Parser test}}
947 * {{PAGESIZE:Parser test}} - {{PAGESIZE:wikipedia:Parser test}}
948 * {{REVISIONID:Parser test}} - {{REVISIONID:wikipedia:Parser test}}
949 * {{REVISIONDAY:Parser test}} - {{REVISIONDAY:wikipedia:Parser test}}
950 * {{REVISIONDAY2:Parser test}} - {{REVISIONDAY2:wikipedia:Parser test}}
951 * {{REVISIONMONTH:Parser test}} - {{REVISIONMONTH:wikipedia:Parser test}}
952 * {{REVISIONMONTH1:Parser test}} - {{REVISIONMONTH1:wikipedia:Parser test}}
953 * {{REVISIONYEAR:Parser test}} - {{REVISIONYEAR:wikipedia:Parser test}}
954 * {{REVISIONTIMESTAMP:Parser test}} - {{REVISIONTIMESTAMP:wikipedia:Parser test}}
955 * {{REVISIONUSER:Parser test}} - {{REVISIONUSER:wikipedia:Parser test}}
956 !! html/php
957 <ul><li>0 - 0</li>
958 <li>0 - 0</li>
959 <li>-</li>
960 <li>1 -</li>
961 <li>01 -</li>
962 <li>01 -</li>
963 <li>1 -</li>
964 <li>1970 -</li>
965 <li>19700101000203 -</li>
966 <li>-</li></ul>
967 !! end
968
969 !! test
970 Magic Word: {{SCRIPTPATH}}
971 !! options
972 parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true }
973 !! wikitext
974 {{SCRIPTPATH}}
975 !! html/php
976 !! html/parsoid+integrated
977 <span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"SCRIPTPATH","function":"scriptpath"},"params":{},"i":0}}]}'></span>
978 !! end
979
980 !! test
981 Magic Word: {{STYLEPATH}}
982 !! options
983 parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true }
984 !! wikitext
985 {{STYLEPATH}}
986 !! html/php
987 <p>/skins
988 </p>
989 !! html/parsoid+integrated
990 <p><span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"STYLEPATH","function":"stylepath"},"params":{},"i":0}}]}'>/skins</span></p>
991 !! end
992
993 !! test
994 Magic Word: {{SERVER}}
995 !! options
996 parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true }
997 !! wikitext
998 {{SERVER}}
999 !! html/*
1000 <p><a rel="nofollow" class="external free" href="http://example.org">http://example.org</a>
1001 </p>
1002 !! end
1003
1004 !! test
1005 Magic Word: {{SERVERNAME}}
1006 !! options
1007 parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true }
1008 !! wikitext
1009 {{SERVERNAME}}
1010 !! html/*
1011 <p>example.org
1012 </p>
1013 !! end
1014
1015 !! test
1016 Magic Word: {{SITENAME}}
1017 !! options
1018 parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true }
1019 !! wikitext
1020 {{SITENAME}}
1021 !! html/*
1022 <p>MediaWiki
1023 </p>
1024 !! end
1025
1026 !! test
1027 Magic Word: {{PAGELANGUAGE}}
1028 !! options
1029 language=fr
1030 parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true }
1031 !! wikitext
1032 {{PAGELANGUAGE}}
1033 !! html/*
1034 <p>fr
1035 </p>
1036 !! end
1037
1038 !! test
1039 Magic Word: {{PAGELANGUAGE}} on a page with no explicitly set language
1040 !! options
1041 parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true }
1042 !! wikitext
1043 {{PAGELANGUAGE}}
1044 !! html/*
1045 <p>en
1046 </p>
1047 !! end
1048
1049 !! test
1050 Magic Word: {{USERLANGUAGE}} disabled
1051 !! config
1052 wgParserEnableUserLanguage=false
1053 !! options
1054 parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true }
1055 language=en
1056 userLanguage=fr
1057 !! wikitext
1058 {{USERLANGUAGE}}
1059 !! html/*
1060 <p>en
1061 </p>
1062 !! end
1063
1064 !! test
1065 Magic Word: {{USERLANGUAGE}} enabled
1066 !! config
1067 wgParserEnableUserLanguage=true
1068 !! options
1069 parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true }
1070 language=en
1071 userLanguage=fr
1072 !! wikitext
1073 {{USERLANGUAGE}}
1074 !! html/*
1075 <p>fr
1076 </p>
1077 !! end
1078
1079 !! test
1080 Case-sensitive magic words, when cased differently, should just be template transclusions
1081 !! wikitext
1082 {{CurrentMonth}}
1083 {{currentday}}
1084 {{cURreNTweEK}}
1085 {{currentHour}}
1086 !! html/php
1087 <p><a href="/index.php?title=Template:CurrentMonth&amp;action=edit&amp;redlink=1" class="new" title="Template:CurrentMonth (page does not exist)">Template:CurrentMonth</a>
1088 <a href="/index.php?title=Template:Currentday&amp;action=edit&amp;redlink=1" class="new" title="Template:Currentday (page does not exist)">Template:Currentday</a>
1089 <a href="/index.php?title=Template:CURreNTweEK&amp;action=edit&amp;redlink=1" class="new" title="Template:CURreNTweEK (page does not exist)">Template:CURreNTweEK</a>
1090 <a href="/index.php?title=Template:CurrentHour&amp;action=edit&amp;redlink=1" class="new" title="Template:CurrentHour (page does not exist)">Template:CurrentHour</a>
1091 </p>
1092 !! html/parsoid
1093 <p><a rel="mw:WikiLink" href="./Template:CurrentMonth?action=edit&amp;redlink=1" title="Template:CurrentMonth" about="#mwt1" typeof="mw:Transclusion mw:LocalizedAttrs" class="new" data-parsoid='{"stx":"simple","a":{"href":"./Template:CurrentMonth"},"sa":{"href":"Template:CurrentMonth"},"pi":[[]]}' data-mw='{"parts":[{"template":{"target":{"wt":"CurrentMonth","href":"./Template:CurrentMonth"},"params":{},"i":0}}]}' data-mw-i18n='{"title":{"lang":"x-page","key":"red-link-title","params":["Template:CurrentMonth"]}}'>Template:CurrentMonth</a>
1094 <a rel="mw:WikiLink" href="./Template:Currentday?action=edit&amp;redlink=1" title="Template:Currentday" about="#mwt2" typeof="mw:Transclusion mw:LocalizedAttrs" class="new" data-parsoid='{"stx":"simple","a":{"href":"./Template:Currentday"},"sa":{"href":"Template:Currentday"},"pi":[[]]}' data-mw='{"parts":[{"template":{"target":{"wt":"currentday","href":"./Template:Currentday"},"params":{},"i":0}}]}' data-mw-i18n='{"title":{"lang":"x-page","key":"red-link-title","params":["Template:Currentday"]}}'>Template:Currentday</a>
1095 <a rel="mw:WikiLink" href="./Template:CURreNTweEK?action=edit&amp;redlink=1" title="Template:CURreNTweEK" about="#mwt3" typeof="mw:Transclusion mw:LocalizedAttrs" class="new" data-parsoid='{"stx":"simple","a":{"href":"./Template:CURreNTweEK"},"sa":{"href":"Template:CURreNTweEK"},"pi":[[]]}' data-mw='{"parts":[{"template":{"target":{"wt":"cURreNTweEK","href":"./Template:CURreNTweEK"},"params":{},"i":0}}]}' data-mw-i18n='{"title":{"lang":"x-page","key":"red-link-title","params":["Template:CURreNTweEK"]}}'>Template:CURreNTweEK</a>
1096 <a rel="mw:WikiLink" href="./Template:CurrentHour?action=edit&amp;redlink=1" title="Template:CurrentHour" about="#mwt4" typeof="mw:Transclusion mw:LocalizedAttrs" class="new" data-parsoid='{"stx":"simple","a":{"href":"./Template:CurrentHour"},"sa":{"href":"Template:CurrentHour"},"pi":[[]]}' data-mw='{"parts":[{"template":{"target":{"wt":"currentHour","href":"./Template:CurrentHour"},"params":{},"i":0}}]}' data-mw-i18n='{"title":{"lang":"x-page","key":"red-link-title","params":["Template:CurrentHour"]}}'>Template:CurrentHour</a></p>
1097 !! end
1098
1099 !! test
1100 Case-insensitive magic words should still work with weird casing.
1101 !! wikitext
1102 {{sErVeRNaMe}}
1103 {{LCFirst:AOEU}}
1104 {{ucFIRST:aoeu}}
1105 {{SERver}}
1106 !! html
1107 <p>example.org
1108 aOEU
1109 Aoeu
1110 <a rel="nofollow" class="external free" href="http://example.org">http://example.org</a>
1111 </p>
1112 !! end
1113
1114 !! test
1115 Magic Word: prioritize type info over data-parsoid
1116 !! options
1117 parsoid=html2wt
1118 !! html/parsoid
1119 <meta property="mw:PageProp/forcetoc" data-parsoid='{"magicSrc":"__NOTOC__"}'/>
1120 !! wikitext
1121 __FORCETOC__
1122 !! end
1123
1124 !! test
1125 Magic Word: serialize on separate line (parsoid)
1126 !! options
1127 parsoid=wt2wt,html2wt
1128 !! wikitext
1129 foo
1130 __NOTOC__
1131 bar
1132 !! html/parsoid
1133 foo<meta property="mw:PageProp/notoc"/>bar
1134 !! end
1135
1136 !! test
1137 Magic Word: case-insensitive (all-lowercase)
1138 !! wikitext
1139 foo
1140 __notoc__
1141 bar
1142 !! html/php
1143 <p>foo
1144 </p><p>bar
1145 </p>
1146 !! html/parsoid
1147 <p>foo
1148 <meta property="mw:PageProp/notoc" data-parsoid='{"src":"__notoc__","magicSrc":"__notoc__"}'/>
1149 bar</p>
1150 !! end
1151
1152 # wt2wt,html2wt disabled because we always (unless selser) serialize
1153 # in a uniform case (all upper or all lower)
1154 !! test
1155 Magic Word: case-insensitive (mixed case)
1156 !! options
1157 parsoid=wt2html,html2html
1158 !! wikitext
1159 foo
1160 __NOtOC__
1161 bar
1162 !! html/php
1163 <p>foo
1164 </p><p>bar
1165 </p>
1166 !! html/parsoid
1167 <p>foo
1168 <meta property="mw:PageProp/notoc" data-parsoid='{"src":"__NOtOC__","magicSrc":"__NOtOC__"}'/>
1169 bar</p>
1170 !! end
1171
1172 !! test
1173 Magic Word: rt non-english wikis
1174 !! options
1175 parsoid=wt2wt
1176 language=de
1177 !! wikitext
1178 __NOEDITSECTION__
1179 !! html/parsoid
1180 <meta property="mw:PageProp/noeditsection" data-parsoid='{"magicSrc":"__NOEDITSECTION__"}'/>
1181 !! end
1182
1183 ## Note that there is no wikitext output for 'unknownproperty' ##
1184 ## Unknown magic words are silently dropped ##
1185
1186 !! test
1187 Magic words
1188 !! options
1189 parsoid=html2wt
1190 !! html/parsoid
1191 <meta property='mw:PageProp/toc' />
1192 <meta property='mw:PageProp/notoc' />
1193 <meta property='mw:PageProp/forcetoc' />
1194 <meta property='mw:PageProp/index' />
1195 <meta property='mw:PageProp/noindex' />
1196 <meta property='mw:PageProp/nogallery' />
1197 <meta property='mw:PageProp/noeditsection' />
1198 <meta property='mw:PageProp/notitleconvert' />
1199 <meta property='mw:PageProp/nocontentconvert' />
1200 <meta property='mw:PageProp/unknownproperty' />
1201 !! wikitext
1202 __TOC__
1203 __NOTOC__
1204 __FORCETOC__
1205 __INDEX__
1206 __NOINDEX__
1207 __NOGALLERY__
1208 __NOEDITSECTION__
1209 __NOTITLECONVERT__
1210 __NOCONTENTCONVERT__
1211 !! end
1212
1213 !! test
1214 New section link / no new section link
1215 !! options
1216 showflags
1217 parsoid={
1218 "wrapSections": true
1219 }
1220 !! wikitext
1221 __NEWSECTIONLINK__ __NONEWSECTIONLINK__
1222 !! metadata
1223 flags=mw-HideNewSection, mw-NewSection
1224 !! html/parsoid
1225 <section data-mw-section-id="0"><meta property="mw:PageProp/newsectionlink" data-parsoid='{"src":"__NEWSECTIONLINK__","magicSrc":"__NEWSECTIONLINK__","dsr":[0,18,null,null]}'/> <meta property="mw:PageProp/nonewsectionlink" data-parsoid='{"src":"__NONEWSECTIONLINK__","magicSrc":"__NONEWSECTIONLINK__"}'/></section>
1226 !! end
1227
1228 !! article
1229 Template:NewSectionLink
1230 !! text
1231 __NEWSECTIONLINK__
1232 !! end
1233
1234 !! test
1235 Templated new section link
1236 !! options
1237 showflags
1238 parsoid={
1239 "wrapSections": true
1240 }
1241 !! wikitext
1242 {{NewSectionLink}}
1243 !! metadata
1244 flags=mw-NewSection
1245 !! html/parsoid
1246 <section data-mw-section-id="0"><meta property="mw:PageProp/newsectionlink" about="#mwt1" typeof="mw:Transclusion" data-parsoid='{"magicSrc":"__NEWSECTIONLINK__","pi":[[]]}' data-mw='{"parts":[{"template":{"target":{"wt":"NewSectionLink","href":"./Template:NewSectionLink"},"params":{},"i":0}}]}'/></section>
1247 !! end
1248