Debian Codegraph @

vendor/wikimedia/parsoid/tests/parser/encapParserTests.txt

raw
1 !! Version 2
2
3 !! article
4 Template:1x
5 !! text
6 {{{1}}}
7 !! endarticle
8
9 !! article
10 Template:T1
11 !! text
12 <pwraptest /><div>foo</div><pwraptest />
13 !! endarticle
14
15 ## This is actually a test of paragraph-wrapping to make sure it doesn't
16 ## combine transparent nodes from multiple tranclusions into a p-wrapper.
17 ## But, since the expectation is on template wrapping in Parsoid, we are
18 ## add this test in this file.
19 !! test
20 Ensure that template encapsulation doesn't wrap multiple templates into a single unit
21 !! options
22 parsoid=wt2html
23 !! wikitext
24 {{T1}}{{T1}}
25 !! html/parsoid
26 <span typeof="mw:Extension/pwraptest mw:Transclusion" about="#mwt1" data-mw='{"name":"pwraptest","attrs":{},"parts":[{"template":{"target":{"wt":"T1","href":"./Template:T1"},"params":{},"i":0}}]}'><!--CMT--></span><style about="#mwt1">p{}</style><div about="#mwt1">foo</div><span typeof="mw:Extension/pwraptest" about="#mwt1" data-mw='{"name":"pwraptest","attrs":{}}'><!--CMT--></span><style about="#mwt1">p{}</style><span typeof="mw:Extension/pwraptest mw:Transclusion" about="#mwt7" data-mw='{"name":"pwraptest","attrs":{},"parts":[{"template":{"target":{"wt":"T1","href":"./Template:T1"},"params":{},"i":0}}]}'><!--CMT--></span><style about="#mwt7">p{}</style><div about="#mwt7">foo</div><span typeof="mw:Extension/pwraptest" about="#mwt7" data-mw='{"name":"pwraptest","attrs":{}}'><!--CMT--></span><style about="#mwt7">p{}</style>
27 !! end
28
29 ## This test demonstrates the pass ordering issue documented
30 ## in the commit message of 9145f812 and ensures any future
31 ## refactoring doesn't regress on this behavior.
32 !! test
33 Ensure that template encapsulation doesn't unnecessarily expand wrapping scope
34 !! options
35 parsoid=wt2html
36 !! wikitext
37 <i>a
38
39 b
40 {{1x|c<div>d</div>}}
41 !! html/parsoid
42 <p><i data-parsoid='{"stx":"html","autoInsertedEnd":true}'>a</i></p><i data-parsoid='{"stx":"html","autoInsertedStart":true,"autoInsertedEnd":true}'>
43
44 <p>b</p></i>
45 <p about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"1x","href":"./Template:1x"},"params":{"1":{"wt":"c&lt;div>d&lt;/div>"}},"i":0}}]}'><i>c</i></p><i about="#mwt1" data-parsoid='{"stx":"html","autoInsertedStart":true,"autoInsertedEnd":true}'><div>d</div></i>
46 !! end