| 1 |
!! Version 2 |
| 2 |
|
| 3 |
## This file contains manual edit tests and primarily are used |
| 4 |
## to spec and verify expectations of selective serialization |
| 5 |
## in the presence of span-wrapping in lists. |
| 6 |
|
| 7 |
!! article |
| 8 |
Template:1x |
| 9 |
!! text |
| 10 |
{{{1}}} |
| 11 |
!! endarticle |
| 12 |
|
| 13 |
!! test |
| 14 |
Don't dirty diff list items up the tree when a sibling list item is added (preserve whitespace) |
| 15 |
!! options |
| 16 |
parsoid={ |
| 17 |
"modes": ["selser"], |
| 18 |
"selser": "noauto", |
| 19 |
"changes": [ |
| 20 |
[ "ul > li > ul > li", "after", "<li>b-new</li>" ] |
| 21 |
] |
| 22 |
} |
| 23 |
!! wikitext |
| 24 |
* a |
| 25 |
** b |
| 26 |
!! wikitext/edited |
| 27 |
* a |
| 28 |
** b |
| 29 |
** b-new |
| 30 |
!! end |
| 31 |
|
| 32 |
!! test |
| 33 |
Template edition: Don't dirty diff list items up the tree when a nested list item is added (preserve whitespace) |
| 34 |
!! options |
| 35 |
parsoid={ |
| 36 |
"modes": ["selser"], |
| 37 |
"selser": "noauto", |
| 38 |
"changes": [ |
| 39 |
[ "ul > li > ul > li", "append", "<ul><li>b-new</li></ul>" ] |
| 40 |
] |
| 41 |
} |
| 42 |
!! wikitext |
| 43 |
* a |
| 44 |
** {{1x|<span>dummy</span> b}} c |
| 45 |
!! wikitext/edited |
| 46 |
* a |
| 47 |
** {{1x|<span>dummy</span> b}} c |
| 48 |
*** b-new |
| 49 |
!! end |
| 50 |
|
| 51 |
!! test |
| 52 |
Don't dirty diff list items up the tree when a nested list item is added (preserve whitespace) |
| 53 |
!! options |
| 54 |
parsoid={ |
| 55 |
"modes": ["selser"], |
| 56 |
"selser": "noauto", |
| 57 |
"changes": [ |
| 58 |
[ "ul > li > ul > li", "append", "<ul><li>b-new</li></ul>" ] |
| 59 |
] |
| 60 |
} |
| 61 |
!! wikitext |
| 62 |
* a |
| 63 |
** b |
| 64 |
!! wikitext/edited |
| 65 |
* a |
| 66 |
** b |
| 67 |
*** b-new |
| 68 |
!! end |
| 69 |
|
| 70 |
!! test |
| 71 |
Don't dirty diff list items up the tree when a sibling list item is added (don't add nowikis) |
| 72 |
!! options |
| 73 |
parsoid={ |
| 74 |
"modes": ["selser"], |
| 75 |
"selser": "noauto", |
| 76 |
"changes": [ |
| 77 |
[ "ul > li > ul > li", "after", "<li>b-new</li>" ] |
| 78 |
] |
| 79 |
} |
| 80 |
!! wikitext |
| 81 |
* a {{x |
| 82 |
** b |
| 83 |
!! wikitext/edited |
| 84 |
* a {{x |
| 85 |
** b |
| 86 |
** b-new |
| 87 |
!! end |
| 88 |
|
| 89 |
!! test |
| 90 |
Don't dirty diff list items up the tree when a nested list item is added (don't add nowikis) |
| 91 |
!! options |
| 92 |
parsoid={ |
| 93 |
"modes": ["selser"], |
| 94 |
"selser": "noauto", |
| 95 |
"changes": [ |
| 96 |
[ "ul > li > ul > li", "append", "<ul><li>b-new</li></ul>" ] |
| 97 |
] |
| 98 |
} |
| 99 |
!! wikitext |
| 100 |
* a {{x |
| 101 |
** b |
| 102 |
!! wikitext/edited |
| 103 |
* a {{x |
| 104 |
** b |
| 105 |
*** b-new |
| 106 |
!! end |
| 107 |
|
| 108 |
!! test |
| 109 |
Don't dirty diff list items up the tree when a sibling list item is added (preserve empty list items) |
| 110 |
!! options |
| 111 |
parsoid={ |
| 112 |
"modes": ["selser"], |
| 113 |
"selser": "noauto", |
| 114 |
"changes": [ |
| 115 |
[ "ul > li > ul > li > ul > li", "after", "<li>b-new</li>" ] |
| 116 |
] |
| 117 |
} |
| 118 |
!! wikitext |
| 119 |
* |
| 120 |
** |
| 121 |
*** b |
| 122 |
!! wikitext/edited |
| 123 |
* |
| 124 |
** |
| 125 |
*** b |
| 126 |
*** b-new |
| 127 |
!! end |
| 128 |
|
| 129 |
!! test |
| 130 |
Don't dirty diff list items up the tree when a nested list item is added (preserve empty list items) |
| 131 |
!! options |
| 132 |
parsoid={ |
| 133 |
"modes": ["selser"], |
| 134 |
"selser": "noauto", |
| 135 |
"changes": [ |
| 136 |
[ "ul > li > ul > li > ul > li", "append", "<ul><li>b-new</li></ul>" ] |
| 137 |
] |
| 138 |
} |
| 139 |
!! wikitext |
| 140 |
* |
| 141 |
** |
| 142 |
*** b |
| 143 |
!! wikitext/edited |
| 144 |
* |
| 145 |
** |
| 146 |
*** b |
| 147 |
**** b-new |
| 148 |
!! end |
| 149 |
|
| 150 |
!! test |
| 151 |
Don't dirty diff list items up the tree when a nested list item is added (preserve unbalanced closing tags - test 1) |
| 152 |
!! options |
| 153 |
parsoid={ |
| 154 |
"modes": ["selser"], |
| 155 |
"selser": "noauto", |
| 156 |
"changes": [ |
| 157 |
[ "ul > li > ul > li", "after", "<li>b-new</li>" ] |
| 158 |
] |
| 159 |
} |
| 160 |
!! wikitext |
| 161 |
* x</span> |
| 162 |
** b |
| 163 |
!! wikitext/edited |
| 164 |
* x</span> |
| 165 |
** b |
| 166 |
** b-new |
| 167 |
!! end |
| 168 |
|
| 169 |
# Without StrippedTag meta marker in the HTML output, this test will cause corruption (HTML version 2.1.1) |
| 170 |
!! test |
| 171 |
Don't dirty diff list items up the tree when a nested list item is added (preserve unbalanced closing tags - test 2) |
| 172 |
!! options |
| 173 |
parsoid={ |
| 174 |
"modes": ["selser"], |
| 175 |
"selser": "noauto", |
| 176 |
"changes": [ |
| 177 |
[ "ul > li > ul > li", "after", "<li>b-new</li>" ] |
| 178 |
] |
| 179 |
} |
| 180 |
!! wikitext |
| 181 |
* </span>x |
| 182 |
** b |
| 183 |
!! wikitext/edited |
| 184 |
* </span>x |
| 185 |
** b |
| 186 |
** b-new |
| 187 |
!! end |
| 188 |
|
| 189 |
!! test |
| 190 |
Verify that our internal selser wrapper can't be spoofed from wikitext |
| 191 |
!! wikitext |
| 192 |
<span data-mw-selser-wrapper="foo">bar</span> |
| 193 |
!! html/parsoid |
| 194 |
<p><span data-x-data-mw-selser-wrapper="foo">bar</span></p> |
| 195 |
!! end |
| 196 |
|
| 197 |
!! test |
| 198 |
Preserve stray </div> tags between unmodified nodes |
| 199 |
!! options |
| 200 |
parsoid={ |
| 201 |
"modes": ["selser"], |
| 202 |
"selser": "noauto", |
| 203 |
"changes": [ |
| 204 |
[ "ul > li", "after", "<li>y-new</li>" ] |
| 205 |
] |
| 206 |
} |
| 207 |
!! wikitext |
| 208 |
<div>foo</div></div> |
| 209 |
<div>bar</div></div> |
| 210 |
abcd |
| 211 |
<div>baz</div></div> |
| 212 |
* x |
| 213 |
!! wikitext/edited |
| 214 |
<div>foo</div></div> |
| 215 |
<div>bar</div></div> |
| 216 |
abcd |
| 217 |
<div>baz</div> |
| 218 |
* x |
| 219 |
* y-new |
| 220 |
!! end |
| 221 |
|
| 222 |
# T269901 |
| 223 |
!! test |
| 224 |
Regression test: No bogus recovery of trimmed whitespace |
| 225 |
!! options |
| 226 |
parsoid={ |
| 227 |
"modes": ["selser"], |
| 228 |
"selser": "noauto", |
| 229 |
"changes": [ |
| 230 |
[ "dl > dd > dl > dd > dl > dd", "html", "d" ] |
| 231 |
] |
| 232 |
} |
| 233 |
!! wikitext |
| 234 |
: a |
| 235 |
:: b |
| 236 |
:* c |
| 237 |
::: FOO |
| 238 |
!! wikitext/edited |
| 239 |
: a |
| 240 |
:: b |
| 241 |
:* c |
| 242 |
::: d |
| 243 |
!! end |
| 244 |
|
| 245 |
## T279963 |
| 246 |
!! test |
| 247 |
Do not reintroduce whitespace when it's captured as a DisplaySpace |
| 248 |
!! options |
| 249 |
parsoid={ |
| 250 |
"modes": ["selser"], |
| 251 |
"selser": "noauto", |
| 252 |
"changes": [ |
| 253 |
[ "dd", "append", " 123" ] |
| 254 |
] |
| 255 |
} |
| 256 |
!! wikitext |
| 257 |
: : test |
| 258 |
!! wikitext/edited |
| 259 |
: : test 123 |
| 260 |
!! html/parsoid |
| 261 |
<dl><dd><span typeof="mw:DisplaySpace"> </span>: test</dd></dl> |
| 262 |
!! end |
| 263 |
|
| 264 |
# NOTE: This test requires (a) at least a nested dl-dd (b) a non-text last non-sep child |
| 265 |
!! test |
| 266 |
Don't dirty diff dd list items up the tree when a different list child is modified |
| 267 |
!! options |
| 268 |
parsoid={ |
| 269 |
"modes": ["selser"], |
| 270 |
"selser": "noauto", |
| 271 |
"changes": [ |
| 272 |
[ "dl > dd > dl > dd:last-child", "append", "<dl><dd>bar</dd></dl>" ] |
| 273 |
] |
| 274 |
} |
| 275 |
!! wikitext |
| 276 |
::x ''y'' |
| 277 |
::z |
| 278 |
!! wikitext/edited |
| 279 |
::x ''y'' |
| 280 |
::z |
| 281 |
::: bar |
| 282 |
!! end |