# Plus any combination of these:
#
# cat add category links
# Plus any combination of these:
#
# cat add category links
-# (ignored by Parsoid, since it emits <link>s)
# ill add inter-language links
# ill add inter-language links
-# (ignored by Parsoid, since it emits <links>s)
+# (ignored by Parsoid, since it emits <link>s)
# subpage enable subpages (disabled by default)
# noxml don't check for XML well-formedness
# title=[[XXX]] run test using article title XXX
# subpage enable subpages (disabled by default)
# noxml don't check for XML well-formedness
# title=[[XXX]] run test using article title XXX
<span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":" [[Category:foo]]"}},"i":0}}]}'> </span><link rel="mw:PageProp/Category" href="./Category:Foo" about="#mwt1"> <!-- No pre-wrapping -->
!! end
<span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":" [[Category:foo]]"}},"i":0}}]}'> </span><link rel="mw:PageProp/Category" href="./Category:Foo" about="#mwt1"> <!-- No pre-wrapping -->
!! end
-## We used to, but no longer wt2wt this test since the default serializer
-## will normalize all categories to serialize on their own line.
-## This wikitext usage is going to be fairly uncommon in production and
-## selser will take care of preserving formatting in those scenarios.
!! test
7b. Indent-pre and category links
!! options
!! test
7b. Indent-pre and category links
!! options
!! wikitext
[[Category:foo]] a
[[Category:foo]] {{echo|b}}
!! wikitext
[[Category:foo]] a
[[Category:foo]] {{echo|b}}
<pre><link rel="mw:PageProp/Category" href="./Category:Foo"> a
<link rel="mw:PageProp/Category" href="./Category:Foo"> <span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"b"}},"i":0}}]}'>b</span></pre>
!! end
<pre><link rel="mw:PageProp/Category" href="./Category:Foo"> a
<link rel="mw:PageProp/Category" href="./Category:Foo"> <span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"b"}},"i":0}}]}'>b</span></pre>
!! end
-## We used to, but no longer wt2wt this test since the default serializer
-## will normalize the include directives to serialize on their own line.
-## Selser will take care of preserving formatting in scenarios where they
-## intermingled with other wikitext.
!! test
Includes and comments at SOL
!! test
Includes and comments at SOL
-!! options
-parsoid=wt2html,html2html
!! wikitext
<!-- comment --><noinclude><!-- comment --></noinclude><!-- comment -->== hu ==
!! wikitext
<!-- comment --><noinclude><!-- comment --></noinclude><!-- comment -->== hu ==
-## We used to, but no longer wt2wt this test since the default serializer
-## will normalize the include directives to serialize on their own line.
-## Selser will take care of preserving formatting in scenarios where they
-## intermingled with other wikitext.
!!test
2. Table tag in SOL posn. should get reparsed correctly with valid TSR
!!options
!!test
2. Table tag in SOL posn. should get reparsed correctly with valid TSR
!!options
!!wikitext
<includeonly>a</includeonly>{| {{{b}}}
|c
!!wikitext
<includeonly>a</includeonly>{| {{{b}}}
|c
[[Category:Foo (bar)|Foo]]
!! end
[[Category:Foo (bar)|Foo]]
!! end
-## We used to, but no longer wt2wt this test since the default serializer
-## will normalize all categories to serialize on their own line.
-## This wikitext usage is going to be fairly uncommon in production and
-## selser will take care of preserving formatting in those scenarios.
!! test
Category with link tail
!! options
cat
pst
!! test
Category with link tail
!! options
cat
pst
!! wikitext
123[[Category:Foo]]456
!! wikitext
123[[Category:Foo]]456
-!! html/parsoid
-<p>123<link rel="mw:PageProp/Category" href="Category:Foo"/>456</p>
[[Category:{{echo|Foo}}|{{echo|Bar}}]]
!! end
[[Category:{{echo|Foo}}|{{echo|Bar}}]]
!! end
-## We used to, but no longer wt2wt this test since the default serializer
-## will normalize all categories to serialize on their own line.
-## This wikitext usage is going to be fairly uncommon in production and
-## selser will take care of preserving formatting in those scenarios.
!! test
Category / paragraph interactions
!! test
Category / paragraph interactions
-!! options
-parsoid=wt2html
!! wikitext
Foo [[Category:Baz]] Bar
!! wikitext
Foo [[Category:Baz]] Bar
[[Category:Baz]]
{{echo|[[Category:Baz]]}}
[[Category:Baz]]
[[Category:Baz]]
{{echo|[[Category:Baz]]}}
[[Category:Baz]]
<p>Foo Bar
</p><p>Foo
Bar
<p>Foo Bar
</p><p>Foo
Bar
-!! html/parsoid
-<p>Foo <link rel="mw:PageProp/Category" href="Category:Baz"/> Bar</p>
-<p>Foo <link rel="mw:PageProp/Category" href="Category:Baz"/> Bar</p>
-<p>Foo <link rel="mw:PageProp/Category" href="Category:Baz"/> Bar</p>
-<p>Foo <link rel="mw:PageProp/Category" href="Category:Baz"/> Bar</p>
-<p>Foo <link rel="mw:PageProp/Category" href="Category:Baz"/> <link rel="mw:PageProp/Category" href="Category:Baz"/> <link rel="mw:PageProp/Category" href="Category:Baz"/> Bar <link rel="mw:PageProp/Category" href="Category:Baz"/> <link rel="mw:PageProp/Category" href="Category:Baz"/> <link rel="mw:PageProp/Category" href="Category:Baz"/> <link rel="mw:PageProp/Category" href="Category:Baz"/> <link rel="mw:PageProp/Category" href="Category:Baz" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"[[Category:Baz]]"}},"i":0}}]}'/></p>
-<link rel="mw:PageProp/Category" href="Category:Baz"/>
-## We used to, but no longer wt2wt this test since the default serializer
-## will normalize all categories to serialize on their own line.
-## This wikitext usage is going to be fairly uncommon in production and
-## selser will take care of preserving formatting in those scenarios.
-##
## The whitespace on the empty line is part of the test. Please do not delete
!! test
1. Categories and newlines: All preceding newlines should be suppressed (courtesy bug 87)
!! options
## The whitespace on the empty line is part of the test. Please do not delete
!! test
1. Categories and newlines: All preceding newlines should be suppressed (courtesy bug 87)
!! options
!! wikitext
This
[[Category:Foo]] and this should be part of same paragraph (not an indent-pre)
{{echo|[[Category:Foo]] and so should this!}}
!! wikitext
This
[[Category:Foo]] and this should be part of same paragraph (not an indent-pre)
{{echo|[[Category:Foo]] and so should this!}}
<p>This and this should be part of same paragraph (not an indent-pre) and so should this!
</p>
!! html/parsoid
<p>This and this should be part of same paragraph (not an indent-pre) and so should this!
</p>
!! html/parsoid
<link rel="mw:PageProp/Category" href="./Category:Foo" data-parsoid='{"stx":"simple","a":{"href":"./Category:Foo"},"sa":{"href":"Category:Foo"}}'/>
!! end
<link rel="mw:PageProp/Category" href="./Category:Foo" data-parsoid='{"stx":"simple","a":{"href":"./Category:Foo"},"sa":{"href":"Category:Foo"}}'/>
!! end
-## We used to, but no longer wt2wt this test since the default serializer
-## will normalize all categories to serialize on their own line.
-## This wikitext usage is going to be fairly uncommon in production and
-## selser will take care of preserving formatting in those scenarios.
!! test
6. Categories and newlines: migrateTrailingCategories dom pass should not migrate categories not preceded by newlines
!! test
6. Categories and newlines: migrateTrailingCategories dom pass should not migrate categories not preceded by newlines
-!! options
-parsoid=wt2html
!! wikitext
* a [[Category:Foo]]
!! html/parsoid
!! wikitext
* a [[Category:Foo]]
!! html/parsoid
* {{echo|a
[[Category:Foo]]}}
!! html/parsoid
* {{echo|a
[[Category:Foo]]}}
!! html/parsoid
-<ul><li> <span about="#mwt1" typeof="mw:Transclusion" data-parsoid='{"pi":[[{"k":"1","spc":["","","",""]}]]}' data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"a\n[[Category:Foo]]"}},"i":0}}]}'>a</span><span about="#mwt1">
+<ul><li> <span about="#mwt1" typeof="mw:Transclusion" data-parsoid='{"pi":[[{"k":"1","spc":["","","",""]}]]}' data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"a\n[[Category:Foo]]"}},"i":0}}]}'>a
</span><link rel="mw:PageProp/Category" href="./Category:Foo" about="#mwt1" data-parsoid='{"stx":"simple","a":{"href":"./Category:Foo"},"sa":{"href":"Category:Foo"}}'/></li></ul>
!! end
</span><link rel="mw:PageProp/Category" href="./Category:Foo" about="#mwt1" data-parsoid='{"stx":"simple","a":{"href":"./Category:Foo"},"sa":{"href":"Category:Foo"}}'/></li></ul>
!! end
-# We used to, but no longer wt2wt this test since the default serializer
-# will normalize all categories to serialize on their own line.
-# This wikitext usage is going to be fairly uncommon in production and
-# selser will take care of preventing whitespace insertion if this
-# occurs in an article.
-#
-# html2html disabled for the same reason (whitespace insertion between
-# x and y).
-#
-# html2wt disabled because it localizes the "Category" namespace.
+# html2wt localizes the "Category" namespace.
+# XXX the <link> element needs an empty data-parsoid attribute, or
+# else the html2html test fails because spaces are inserted.
!! test
Link prefix/suffixes aren't applied to category links
!! options
!! test
Link prefix/suffixes aren't applied to category links
!! options
+parsoid=wt2html,wt2wt,html2html
language=is
!! wikitext
x[[Category:Foo]]y
language=is
!! wikitext
x[[Category:Foo]]y
-## We used to, but no longer wt2wt this test since the default serializer
-## will normalize all categories to serialize on their own line.
-## This wikitext usage is going to be fairly uncommon in production and
-## selser will take care of preserving formatting in those scenarios.
!! test
Don't convert blue categorylinks to another variant (bug 33210)
!! options
!! test
Don't convert blue categorylinks to another variant (bug 33210)
!! options
-cat
-language=zh
-parsoid=wt2html
!! wikitext
[[A]][[Category:分类]]
!! wikitext
[[A]][[Category:分类]]
<a href="/wiki/Category:%E5%88%86%E7%B1%BB" title="Category:分类">分类</a>
<a href="/wiki/Category:%E5%88%86%E7%B1%BB" title="Category:分类">分类</a>
-!! html/parsoid
-<p><a rel="mw:WikiLink" href="A" title="A">A</a></p>
-<link rel="mw:PageProp/Category" href="Category:分类"/>
!! test
Stripping -{}- tags (language variants)
!! options
!! test
Stripping -{}- tags (language variants)
!! options
<p>this is not a link: http://example.com
</p>
!! wikitext
<p>this is not a link: http://example.com
</p>
!! wikitext
-<nowiki>this is not a link: http://example.com</nowiki>
+this is not a link: <nowiki>http://example.com</nowiki>
!! end
#### --------------- HTML tags ---------------
!! end
#### --------------- HTML tags ---------------
!! html/parsoid
<p>http://example.com is not a link.</p>
!! wikitext
!! html/parsoid
<p>http://example.com is not a link.</p>
!! wikitext
-<nowiki>http://example.com is not a link.</nowiki>
+<nowiki>http://example.com</nowiki> is not a link.
!! html/parsoid
<p><a rel="mw:ExtLink" href="http://example.com">http://example.com</a> http://example.com is not a link.</p>
!! wikitext
!! html/parsoid
<p><a rel="mw:ExtLink" href="http://example.com">http://example.com</a> http://example.com is not a link.</p>
!! wikitext
-http://example.com<nowiki> http://example.com is not a link.</nowiki>
+http://example.com <nowiki>http://example.com</nowiki> is not a link.
# Tests spec'ing wikitext serialization norms |
# --------------------------------------------
# Tests spec'ing wikitext serialization norms |
# --------------------------------------------
-!! test
-1. Categories should always be serialized on their own line
-!! options
-parsoid=html2wt
-!! html/parsoid
-foo<link rel="mw:PageProp/Category" href="./Category:Foo">bar
-!! wikitext
-foo
-[[Category:Foo]]
-bar
-!! end
-
-!! test
-2. Categories that are part of templates should not introduce a line break
-!! wikitext
-foo {{echo|<span>bar</span> [[Category:baz]]}} bar
-!! html/parsoid
-<p>foo <span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"<span>bar</span> [[Category:baz]]"}},"i":0}}]}'>bar</span><span about="#mwt1"> </span><link rel="mw:PageProp/Category" href="./Category:Baz" about="#mwt1" data-parsoid='{"stx":"simple","a":{"href":"./Category:Baz"},"sa":{"href":"Category:baz"}}'/> bar</p>
-!! end
-
!! test
Lists: Add space after bullets
!! options
!! test
Lists: Add space after bullets
!! options