| 1 |
!! Version 2 |
| 2 |
# |
| 3 |
# This file will hold tests for separator handling functionality |
| 4 |
|
| 5 |
!! article |
| 6 |
Template:1x |
| 7 |
!! text |
| 8 |
{{{1}}} |
| 9 |
!! endarticle |
| 10 |
|
| 11 |
# This is a regression test that indirectly tests the expectation |
| 12 |
# by ensuring that there are no nowikis around [2] on the second line |
| 13 |
!! test |
| 14 |
Newlines reset separator state |
| 15 |
!! options |
| 16 |
parsoid=wt2wt |
| 17 |
!! wikitext |
| 18 |
{| |
| 19 |
|[[Foo]] [1] |
| 20 |
|[[Bar]] [2] |
| 21 |
|} |
| 22 |
!! html/parsoid |
| 23 |
NOT NEEDED |
| 24 |
!! end |
| 25 |
|
| 26 |
!! test |
| 27 |
Selser: Reuse separator before first content node of body |
| 28 |
!! options |
| 29 |
parsoid={ |
| 30 |
"modes": ["selser"], |
| 31 |
"selser": "noauto", |
| 32 |
"changes": [ |
| 33 |
[ "p", "html", "BAR" ] |
| 34 |
] |
| 35 |
} |
| 36 |
!! wikitext |
| 37 |
<noinclude>{{1x|<div>foo</div>}}</noinclude> |
| 38 |
|
| 39 |
FOO |
| 40 |
!! wikitext/edited |
| 41 |
<noinclude>{{1x|<div>foo</div>}}</noinclude> |
| 42 |
|
| 43 |
BAR |
| 44 |
!! end |
| 45 |
|
| 46 |
!! test |
| 47 |
Insertions: Separators recovered from original source |
| 48 |
!! options |
| 49 |
parsoid={ |
| 50 |
"modes": ["selser"], |
| 51 |
"selser": "noauto", |
| 52 |
"changes": [ |
| 53 |
[ "li:nth-child(3)", "append", "<ul><li>c-new</li></ul>" ], |
| 54 |
[ "li:nth-child(4)", "append", "<ul><li>d-new</li></ul>" ] |
| 55 |
] |
| 56 |
} |
| 57 |
!! wikitext |
| 58 |
* a |
| 59 |
* b<!--c1--> |
| 60 |
* c <!--c2--> |
| 61 |
* d <!--c3--> |
| 62 |
!! wikitext/edited |
| 63 |
* a |
| 64 |
* b<!--c1--> |
| 65 |
* c <!--c2--> |
| 66 |
** c-new |
| 67 |
* d <!--c3--> |
| 68 |
** d-new |
| 69 |
!! end |
| 70 |
|
| 71 |
# Regression test for T280050 |
| 72 |
!! test |
| 73 |
Ensure DSR fixups for misnested links don't lead to incorrect separator reuse |
| 74 |
!! options |
| 75 |
parsoid={ |
| 76 |
"modes": ["selser"], |
| 77 |
"selser": "noauto", |
| 78 |
"changes": [ |
| 79 |
[ "li:nth-child(1)", "append", "<ul><li>foo</li></ul>" ] |
| 80 |
] |
| 81 |
} |
| 82 |
!! wikitext |
| 83 |
* [http://example.org Misnested [[wikilink]] in extlink]. More text. |
| 84 |
!! wikitext/edited |
| 85 |
* [http://example.org Misnested [[wikilink]] in extlink]. More text. |
| 86 |
** foo |
| 87 |
!! end |
| 88 |
|
| 89 |
# Regression test for T276512 |
| 90 |
!! test |
| 91 |
Don't strip excess new lines before/after an unmodified rendering-transparent node |
| 92 |
!! options |
| 93 |
parsoid={ |
| 94 |
"modes": ["selser"], |
| 95 |
"selser": "noauto", |
| 96 |
"changes": [ |
| 97 |
[ "p", "after", "\n<ul><li>x</li></ul>" ] |
| 98 |
] |
| 99 |
} |
| 100 |
!! wikitext |
| 101 |
foo |
| 102 |
|
| 103 |
<!--bar--> |
| 104 |
|
| 105 |
[[Category:Baz]] |
| 106 |
!! wikitext/edited |
| 107 |
foo |
| 108 |
|
| 109 |
* x |
| 110 |
|
| 111 |
<!--bar--> |
| 112 |
|
| 113 |
[[Category:Baz]] |
| 114 |
!! end |
| 115 |
|
| 116 |
!! test |
| 117 |
Ensure that make-sep-indent-pre-safe logic isn't tripped up by newlines in comments |
| 118 |
!! options |
| 119 |
parsoid=html2wt |
| 120 |
!! html/parsoid |
| 121 |
<!-- cmt |
| 122 |
--><p>x</p> |
| 123 |
!! wikitext |
| 124 |
<!-- cmt |
| 125 |
-->x |
| 126 |
!! html/php |
| 127 |
<p>x |
| 128 |
</p> |
| 129 |
!! end |