Needed to fix these up in order to get them running right when the Parsoid
test-runner begins to let through more attributes.
Several tests are make wt2html/wt2wt only because they involve templates
which we can't convert from html2wt without additional information.
The "SOL-sensitive wikitext tokens" test was previously wrong: the PHP
preprocessor generates lists from the template content. Updated it to
the proper results while adding attributes, although it will currently
fail until we either fix the native Parsoid preprocessor or tweak our
parserTests to use the PHP preprocessor.
Co-Author: Mark Holmquist <mtraceur@member.fsf.org>
Co-Author: C. Scott Ananian <cscott@cscott.net>
Change-Id: I657e4869fb0c2ae66d6732d28c6fc6645ad8e534
*#*#;*;;foo :bar
*#*#;boo :baz
!! result
*#*#;*;;foo :bar
*#*#;boo :baz
!! result
-<ul><li><ol><li><ul><li><ol><li><dl><dt><ul><li><dl><dt><dl><dt>foo </dt><dd>bar
-</dd></dl></dt></dl></li></ul></dt><dt>boo </dt><dd>baz</dd></dl></li></ol></li></ul></li></ol></li></ul>
+<ul>
+<li>
+<ol>
+<li>
+<ul>
+<li>
+<ol>
+<li>
+<dl>
+<dt>
+<ul>
+<li>
+<dl>
+<dt>
+<dl>
+<dt>foo<span typeof="mw:Placeholder" data-parsoid='{"src":" "}'> </span></dt>
+<dd data-parsoid='{"stx":"row"}'>bar</dd></dl></dt></dl></li></ul></dt>
+<dt>boo<span typeof="mw:Placeholder" data-parsoid='{"src":" "}'> </span></dt>
+<dd data-parsoid='{"stx":"row"}'>baz</dd></dl></li></ol></li></ul></li></ol></li></ul>
!! input
*#;*::;; foo : bar (who uses this?)
!! result
!! input
*#;*::;; foo : bar (who uses this?)
!! result
-<ul><li><ol><li><dl><dt><ul><li><dl><dd><dl><dd><dl><dt><dl><dt> foo </dt><dd> bar (who uses this?)</dd></dl></dt></dl></dd></dl></dd></dl></li></ul></dt></dl></li></ol></li></ul>
+<ul>
+<li>
+<ol>
+<li>
+<dl>
+<dt>
+<ul>
+<li>
+<dl>
+<dd>
+<dl>
+<dd>
+<dl>
+<dt>
+<dl>
+<dt> foo<span typeof="mw:Placeholder" data-parsoid='{"src":" "}'> </span></dt>
+<dd data-parsoid='{"stx":"row"}'> bar (who uses this?)</dd></dl></dt></dl></dd></dl></dd></dl></li></ul></dt></dl></li></ol></li></ul>
!!test
Templates: P-wrapping: 1d. Template preceded by comment-only line
!!options
!!test
Templates: P-wrapping: 1d. Template preceded by comment-only line
!!options
!!input
<!-- foo -->
{{echo|Bar}}
!!result
<!-- foo -->
!!input
<!-- foo -->
{{echo|Bar}}
!!result
<!-- foo -->
+<p typeof="mw:Object/Template">Bar
Templates: Ugly nesting: 2. Quotes opened/closed across templates (echo_with_span)
(PHP parser generates misnested html)
!! options
Templates: Ugly nesting: 2. Quotes opened/closed across templates (echo_with_span)
(PHP parser generates misnested html)
!! options
!!input
{{echo_with_span|''a}}{{echo_with_span|b''c''d}}{{echo_with_span|''e}}
!!result
!!input
{{echo_with_span|''a}}{{echo_with_span|b''c''d}}{{echo_with_span|''e}}
!!result
-<p><span><i>a</i></span><i><span>b</span></i><span>c</span><i>d</i><span>e</span></p>
+<p><span typeof="mw:Object/Template"><i>a</i></span><i typeof="mw:Object/Template"><span>b</span></i><span>c</span><i>d</i><span>e</span></p>
!!end
!!test
Templates: Ugly nesting: 3. Quotes opened/closed across templates (echo_with_div)
(PHP parser generates misnested html)
!! options
!!end
!!test
Templates: Ugly nesting: 3. Quotes opened/closed across templates (echo_with_div)
(PHP parser generates misnested html)
!! options
!!input
{{echo_with_div|''a}}{{echo_with_div|b''c''d}}{{echo_with_div|''e}}
!!result
!!input
{{echo_with_div|''a}}{{echo_with_div|b''c''d}}{{echo_with_div|''e}}
!!result
-<div><i>a</i></div>
-<div><i>b</i>c<i>d</i></div>
-<div>e</div>
+<div typeof="mw:Object/Template"><i>a</i></div>
+<div typeof="mw:Object/Template"><i>b</i>c<i>d</i></div>
+<div typeof="mw:Object/Template">e</div>
-<table about="#mwt1" typeof="mw:Object/Template ">
-<tbody><tr><td>foo</td></tr></tbody></table><span about="#mwt1">
-bar</span><span about="#mwt1">
-</span>
+<table typeof="mw:Object/Template">
+<tbody>
+<tr>
+<td>foo</td></tr></tbody></table><span>bar</span>
wiki<nowiki>nowiki<!--nowiki</nowiki>wiki
!!end
wiki<nowiki>nowiki<!--nowiki</nowiki>wiki
!!end
+# Leading @ in this template definition works around a limitation
+# in parsoid's parserTests which otherwise strips the <span> from the
+# result (confusing it for a template wrapper)
!! article
Template:dangerous
!!text
!! article
Template:dangerous
!!text
-<span onmouseover="alert('crap')">Oh no</span>
+@<span onmouseover="alert('crap')">Oh no</span>
!! input
{{Template:dangerous}}
!! result
!! input
{{Template:dangerous}}
!! result
!!test
1. SOL-sensitive wikitext tokens as template-args
!!options
!!test
1. SOL-sensitive wikitext tokens as template-args
!!options
!!input
{{echo|*a}}
{{echo|#a}}
{{echo|:a}}
!!result
!!input
{{echo|*a}}
{{echo|#a}}
{{echo|:a}}
!!result
+<span about="#mwt1" typeof="mw:Object/Template">
+</span><ul about="#mwt1"><li>a</li></ul>
+<span about="#mwt2" typeof="mw:Object/Template">
+</span><ol about="#mwt2"><li>a</li></ol>
+<span about="#mwt3" typeof="mw:Object/Template">
+</span><dl about="#mwt3"><dd>a</dd></dl>
!!end
#### The following section of tests are primarily to test
!!end
#### The following section of tests are primarily to test
=foo''a''<nowiki>=</nowiki>
!! result
=foo''a''<nowiki>=</nowiki>
!! result
-<p>=foo=
-</p><p> =foo=
-</p><p><!--cmt-->=foo=
-</p><p>=foo<i>a</i>=
-</p>
+<p><span typeof="mw:Nowiki">=foo=</span></p>
+
+<p><span typeof="mw:Nowiki"> =foo= </span>
+<!--cmt-->
+<span typeof="mw:Nowiki">=foo=</span></p>
+
+<p>=foo<i>a</i><span typeof="mw:Nowiki">=</span></p>
=====<nowiki>=foo=</nowiki>=====
======<nowiki>=foo=</nowiki>======
!! result
=====<nowiki>=foo=</nowiki>=====
======<nowiki>=foo=</nowiki>======
!! result
-<h1>=foo=</h1>
-<h2>=foo=</h2>
-<h3>=foo=</h3>
-<h4>=foo=</h4>
-<h5>=foo=</h5>
-<h6>=foo=</h6>
+<h1><span typeof="mw:Nowiki">=foo=</span></h1>
+<h2><span typeof="mw:Nowiki">=foo=</span></h2>
+<h3><span typeof="mw:Nowiki">=foo=</span></h3>
+<h4><span typeof="mw:Nowiki">=foo=</span></h4>
+<h5><span typeof="mw:Nowiki">=foo=</span></h5>
+<h6><span typeof="mw:Nowiki">=foo=</span></h6>
!! input
=='''bold'''<nowiki>foo=</nowiki>=
!! result
!! input
=='''bold'''<nowiki>foo=</nowiki>=
!! result
-<h1>=<b>bold</b>foo=</h1>
+<h1>=<b>bold</b><span typeof="mw:Nowiki">foo=</span></h1>
<h2>=foo</h2>
<h2>foo=</h2>
<h1><i>=</i>foo=</h1>
<h2>=foo</h2>
<h2>foo=</h2>
<h1><i>=</i>foo=</h1>
+<h1><span typeof="mw:Nowiki">=</span></h1>
<!--cmt--><nowiki>=h1=</nowiki>
<!--cmt--><nowiki> =h1= </nowiki>
!! result
<!--cmt--><nowiki>=h1=</nowiki>
<!--cmt--><nowiki> =h1= </nowiki>
!! result
-<p><!--cmt-->=h1=
-<!--cmt--> =h1=
-</p>
+<p><!--cmt--><span typeof="mw:Nowiki">=h1=</span>
+<!--cmt--><span typeof="mw:Nowiki"> =h1= </span></p>
!!end
#### --------------- Lists ---------------
!!end
#### --------------- Lists ---------------
</li></ul>
<ul><li><i>foo</i>*bar
</li></ul>
</li></ul>
<ul><li><i>foo</i>*bar
</li></ul>
-<ul><li><a href="Foo" rel="mw:WikiLink">Foo</a>: bar
+<ul><li><a rel="mw:WikiLink" href="Foo">Foo</a>: bar
!! input
<!--cmt--><nowiki>*foo</nowiki>
!! result
!! input
<!--cmt--><nowiki>*foo</nowiki>
!! result
+<p><!--cmt--><span typeof="mw:Nowiki">*foo</span></p>
----=foo=
----*foo
!! result
----=foo=
----*foo
!! result
+<hr><span typeof="mw:Nowiki">----</span>
<hr>=foo=
<hr>*foo
!! end
<hr>=foo=
<hr>*foo
!! end
|<nowiki>foo|bar</nowiki>
|}
!! result
|<nowiki>foo|bar</nowiki>
|}
!! result
-<table><tbody>
-<tr><td>foo|bar
-</td></tr></tbody></table>
-
+<table><tbody><tr>
+<td><span typeof="mw:Nowiki">foo|bar</span></td></tr></tbody></table>
|''it''<nowiki>foo||bar</nowiki>
|}
!! result
|''it''<nowiki>foo||bar</nowiki>
|}
!! result
-<table><tbody>
-<tr><td>foo||bar
-</td><td><i>it</i>foo||bar
-</td></tr></tbody></table>
-
+<table><tbody><tr>
+<td><span typeof="mw:Nowiki">foo||bar</span></td>
+<td><i>it</i><span typeof="mw:Nowiki">foo||bar</span></td></tr></tbody></table>
-<table><tbody>
-<tr><td>foo!!bar
+<table><tbody><tr><td>foo!!bar
</td></tr></tbody></table>
!! end
</td></tr></tbody></table>
!! end
-<table><tbody>
-<tr><th>foo!bar
+<table><tbody><tr><th>foo!bar
</th></tr></tbody></table>
!! end
</th></tr></tbody></table>
!! end
!<nowiki>foo!!bar</nowiki>
|}
!! result
!<nowiki>foo!!bar</nowiki>
|}
!! result
-<table><tbody>
-<tr><th>foo!!bar
-</th></tr></tbody></table>
-
+<table>
+<tbody><tr><th><span typeof="mw:Nowiki">foo!!bar</span></th></tr>
+</tbody></table>
!<nowiki>foo||bar</nowiki>
|}
!! result
!<nowiki>foo||bar</nowiki>
|}
!! result
-<table><tbody>
-<tr><th>foo||bar
-</th></tr></tbody></table>
-
+<table><tbody><tr>
+<th><span typeof="mw:Nowiki">foo||bar</span></th></tr></tbody></table>
!! result
<table><tbody>
<tr><th>-bar</th></tr>
!! result
<table><tbody>
<tr><th>-bar</th></tr>
-<tr><td>-bar</td></tr>
-</tbody></table>
+<tr>
+<td><span typeof="mw:Nowiki">-bar</span></td></tr></tbody></table>
!! result
<table><tbody>
<tr><th>+bar</th></tr>
!! result
<table><tbody>
<tr><th>+bar</th></tr>
-<tr><td>+bar</td></tr>
-</tbody></table>
+<tr>
+<td><span typeof="mw:Nowiki">+bar</span></td></tr></tbody></table>
Empty TR followed by a template-generated TR
(Parsoid-specific since PHP parser doesn't handle this mixed tbl-wikitext)
!!options
Empty TR followed by a template-generated TR
(Parsoid-specific since PHP parser doesn't handle this mixed tbl-wikitext)
!!options
+<tr></tr>
+<tr typeof="mw:Object/Template">
<td>foo</td></tr></tbody></table>
!!end
<td>foo</td></tr></tbody></table>
!!end