}
if ($GLOBALS['wgUseTidy']) {
+ $out = Parser::tidy($out);
$result = Parser::tidy($result);
}
}
'wgLoadBalancer' => LoadBalancer::newFromParams( $GLOBALS['wgDBservers'] ),
'wgLang' => new LanguageUtf8(),
- 'wgNamespacesWithSubpages' => array( 0 => preg_match('/subpage/i', $opts)),
+ 'wgNamespacesWithSubpages' => array( 0 => preg_match('/\\bsubpage\\b/i', $opts)),
);
$this->savedGlobals = array();
foreach( $settings as $var => $val ) {
# The syntax should be fairly self-explanatory.
#
# Currently supported test options:
+# One of the following three:
+#
# (default) generate HTML output
# pst apply pre-save transform
# msg apply message transform
+#
+# Plus any combination of these:
+#
# cat add category links
# ill add inter-language links
# subpage enable subpages (disabled by default)
</p>
!! end
+!! test
+Template from main namespace
+!! input
+{{:Main Page}}
+!! result
+<p>blah blah
+</p>
+!! end
!! article
Template:table
</p>
!! end
+
+!! article
+Template:MSGNW test
+!! text
+''None'' of '''this''' should be
+* interepreted
+ but rather passed unmodified
+{{test}}
+!! endarticle
+
+# hmm, fix this or just disable/deprecate msgnw?
+!! test
+msgnw keyword
+!! input
+{{msgnw:MSGNW test}}
+!! result
+<p>''None'' of '''this''' should be
+* interepreted
+ but rather passed unmodified
+{{test}}
+</p>
+!! end
+
+!! test
+int keyword
+!! input
+{{int:newmessages|lots of money}}
+!! result
+<p>You have lots of money.
+</p>
+!! end
+
###
### Pre-save transform tests
###
</p>
!! end
-# bug 561: it would be nice if this linked to /subpage -- wtm
!! test
Disabled subpages
!! input
[[/subpage]]
!! result
-<p><a href="/index.php?title=Subpage&action=edit" class="new" title="Subpage">subpage</a>
+<p><a href="/index.php?title=/subpage&action=edit" class="new" title="/subpage">/subpage</a>
</p>
!! end
!! test
BUG 561: {{/Subpage}}
!! options
-title=[[Page]]
+subpage title=[[Page]]
!! input
{{/Subpage}}
!! result
!! end
+!! article
+Template:sections
+!! text
+===Section 1===
+==Section 2==
+!! endarticle
+
+!! test
+Template with sections, __NOTOC__
+!! options title=[[Parser test script]]
+!! input
+__NOTOC__
+==Section 0==
+{{sections}}
+==Section 4==
+!! result
+<div class="editsection" style="float:right;margin-left:5px;">[<a href="/index.php?title=Parser_test_script&action=edit&section=1" title="Parser test script">edit</a>]</div><a name="Section_0"></a><h2>Section 0</h2>
+<div class="editsection" style="float:right;margin-left:5px;">[<a href="/index.php?title=Template:Sections&action=edit&section=1" title="Template:Sections">edit</a>]</div><a name="Section_1"></a><h3>Section 1</h3>
+<div class="editsection" style="float:right;margin-left:5px;">[<a href="/index.php?title=Template:Sections&action=edit&section=2" title="Template:Sections">edit</a>]</div><a name="Section_2"></a><h2>Section 2</h2>
+<div class="editsection" style="float:right;margin-left:5px;">[<a href="/index.php?title=Parser_test_script&action=edit&section=2" title="Parser test script">edit</a>]</div><a name="Section_4"></a><h2>Section 4</h2>
+
+!! end
+
+!! test
+__NOEDITSECTION__ keyword
+!! input
+__NOEDITSECTION__
+==Section 1==
+==Section 2==
+!! result
+<a name="Section_1"></a><h2>Section 1</h2>
+<a name="Section_2"></a><h2>Section 2</h2>
+
+!! end
+
TODO:
more images
more tables