Debian Codegraph @

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

raw
1 # We don't need to run these tests in integrated mode as well.
2 !! options
3 version=2
4 !! end
5
6 !!article
7 Bar
8 !!text
9 abcd
10 !!endarticle
11
12 !! article
13 Template:1x
14 !! text
15 {{{1}}}
16 !! endarticle
17
18 # We need the span in the wikilink so that the link text is
19 # processed as a DOMFragment which then triggers the regression
20 # we are testing in this file
21 !!article
22 Template:RegressionTest
23 !!text
24 [[Bar|<span>bar</span>]]
25 !!endarticle
26
27 # Regression test -- ensure that nested pipeline TSR information
28 # doesn't leak onto the top-level pipeline during DSR computation.
29 # We verify this indirectly via passing selser tests.
30 !!test
31 Regression Test: Ensure nested pipeline TSR doesn't impact top-level DSR values
32 !!wikitext
33 {{RegressionTest}}
34
35 Bar
36 !!html/parsoid
37 <p><a rel="mw:WikiLink" href="./Bar" title="Bar" about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"RegressionTest","href":"./Template:RegressionTest"},"params":{},"i":0}}]}'><span>bar</span></a></p>
38
39 <p>Bar</p>
40 !!end
41
42 # As seen in T334957#9026561
43 !! test
44 Ensure proper DSR offsets are computed
45 !! options
46 parsoid=wt2html,selser
47 !! wikitext
48 {|
49 |-
50
51 é
52
53 ''x''
54
55 * {{1x|
56 {{{!}}
57 {{!}}-
58 }}
59 !! html/parsoid
60 <p data-parsoid='{"fostered":true,"autoInsertedStart":true}'>
61
62 é
63
64 <i>x</i></p><ul data-parsoid='{"fostered":true}'><li class="mw-empty-elt"></li></ul><table about="#mwt1" typeof="mw:Transclusion" data-parsoid='{"autoInsertedEnd":true}' data-mw='{"parts":[{"template":{"target":{"wt":"1x","href":"./Template:1x"},"params":{"1":{"wt":"\n{{{!}}\n{{!}}-\n"}},"i":0}},"{|\n|-\n\né\n\n&apos;&apos;x&apos;&apos;\n\n* {{1x|\n{{{!}}\n{{!}}-\n}}"]}'>
65 <tbody></tbody></table><table about="#mwt1">
66 <tbody>
67 </tbody></table>
68 !! end
69
70 # This is just a regression test to ensure code can handle tables with fosterable content
71 # in DOM fragment position (Ex: image captions). This is an edge case and didn't feel it
72 # belonged in media.txt which already has a number of tests with tables in captions.
73 !! test
74 Images with captions containing tables with fosterable content shouldn't crash Parsoid
75 !! options
76 parsoid=wt2html
77 !! wikitext
78 [[File:Foobar.jpg|thumb|50px|
79 {|
80 {{1x|<span>foo</span>}}
81 |}
82 ]]
83 !! html/parsoid
84 <figure typeof="mw:File/Thumb" data-parsoid='{"optList":[{"ck":"thumbnail","ak":"thumb"},{"ck":"width","ak":"50px"},{"ck":"caption","ak":"\n{|\n{{1x|&lt;span>foo&lt;/span>}}\n|}\n"}]}'><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/50px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="6" width="50" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/75px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/100px-Foobar.jpg 2x" class="mw-file-element" data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"6","width":"50"},"sa":{"resource":"File:Foobar.jpg"}}'/></a><figcaption>
85 <p about="#mwt2" typeof="mw:Transclusion" data-parsoid='{"fostered":true,"autoInsertedStart":true,"firstWikitextNode":"TABLE","pi":[[{"k":"1"}]]}' data-mw='{"parts":["{|\n",{"template":{"target":{"wt":"1x","href":"./Template:1x"},"params":{"1":{"wt":"&lt;span>foo&lt;/span>"}},"i":0}},"\n|}"]}'><span>foo</span></p><table about="#mwt2">
86
87 </table>
88 </figcaption></figure>
89 !! end