diff --git a/tests/parser/citeParserTests.txt b/tests/parser/citeParserTests.txt
index 3f25aca3e..529d1342b 100644
--- a/tests/parser/citeParserTests.txt
+++ b/tests/parser/citeParserTests.txt
@@ -17,21 +17,29 @@ Template:refinref
[ho]
!! endarticle
+## Parsoid only drops autoGenerated references lists in rt testing
!! test
Simple [, no
+!! options
+parsoid=wt2html
!! wikitext
Wikipedia rocks!][Proceeds of Rockology, vol. XXI]
-!! html
+!! html/php
Wikipedia rocks![1]
- ↑ Proceeds of Rockology, vol. XXI
+!! html/parsoid
+Wikipedia rocks![1]
+- ↑ Proceeds of Rockology, vol. XXI
!! end
!! test
Simple [, no , page ends in a list
+!! options
+parsoid=wt2html
!! wikitext
blah][foo] --Matma Rex 17:35, 31 March 2020 (UTC)
* bleh --Matma Rex 17:35, 31 March 2020 (UTC)
@@ -43,6 +51,10 @@ blah[foo] --Matma Rex 17:35, 31 March 2020 (UTC)
↑ foo
+!! html/parsoid
+blah[1] --Matma Rex 17:35, 31 March 2020 (UTC)
+- bleh --Matma Rex 17:35, 31 March 2020 (UTC)
+- ↑ foo
!! end
!! test
@@ -51,13 +63,17 @@ Simple [, with
Wikipedia rocks!][Proceeds of Rockology, vol. XXI]
-!! html
+!! html/php
Wikipedia rocks![1]
- ↑ Proceeds of Rockology, vol. XXI
+!! html/parsoid
+Wikipedia rocks![1]
+
+- ↑ Proceeds of Rockology, vol. XXI
!! end
!! article
@@ -72,14 +88,18 @@ A ''simple'' template.
!! wikitext
Templating[{{simple template}}]
-
-!! html
+
+!! html/php
Templating[1]
+!! html/parsoid
+Templating[1]
+
+- ↑ A simple template.
!! end
!! test
@@ -88,13 +108,17 @@ Templating[{{simple template}}]
Templating[{{simple template}}]
-!! html
+!! html/php
Templating[1]
+!! html/parsoid
+Templating[1]
+
+- ↑ {{simple template}}
!! end
@@ -155,7 +179,7 @@ Templating[Text]
!! html/parsoid
-
+
- ↑ boo
!! end
@@ -186,7 +210,7 @@ parsoid=wt2html,wt2wt
x |
-- ↑ boo
+- ↑ boo
!! end
@@ -278,7 +302,7 @@ Ref with content followed by blank ref
-!! html
+!! html/php
[1]
[1]
@@ -286,6 +310,12 @@ Ref with content followed by blank ref
↑ 1.0 1.1 content
+!! html/parsoid
+[1]
+
+[1]
+
+- 1 2 content
!! end
!! test
@@ -296,7 +326,7 @@ Blank ref followed by ref with content
[content]
-!! html
+!! html/php
[1]
[1]
@@ -304,6 +334,12 @@ Blank ref followed by ref with content
↑ 1.0 1.1 content
+!! html/parsoid
+[1]
+
+[1]
+
+- 1 2 content
!! end
!! test
@@ -314,7 +350,7 @@ Regression: non-blank ref "0" followed by ref with content
[content]
-!! html
+!! html/php
[1]
[1]
@@ -322,6 +358,12 @@ Regression: non-blank ref "0" followed by ref with content
↑ 1.0 1.1 0 Cite error: Invalid <ref>
tag; name "blank" defined multiple times with different content
+!! html/parsoid
+[1]
+
+[1]
+
+- 1 2 0
!! end
!! test
@@ -332,7 +374,7 @@ Regression sanity check: non-blank ref "1" followed by ref with content
[content]
-!! html
+!! html/php
[1]
[1]
@@ -340,6 +382,12 @@ Regression sanity check: non-blank ref "1" followed by ref with content
↑ 1.0 1.1 1 Cite error: Invalid <ref>
tag; name "blank" defined multiple times with different content
+!! html/parsoid
+[1]
+
+[1]
+
+- 1 2 1
!! end
!! test
@@ -747,6 +795,36 @@ T242437 - Nested references edge case, inner tag function with LDR
!! end
+!! test
+[ ungrouped and grouped refs with and without content defined
+!! wikitext
+ONE]
+
+TWO
+THREE[CONTENT]
+
+!! html/parsoid
+ONE[1]
+- ↑
+TWO[NOTES 1]
+THREE[NOTES 2]
+- ↑
- ↑ CONTENT
+!! html/php
+ONE[1]
+
+
+- ↑ Cite error: Invalid
<ref>
tag; no text was provided for refs named foo
+
+TWO[NOTES 1]
+THREE[NOTES 2]
+
+
+- ↑ Cite error: Invalid
<ref>
tag; no text was provided for refs named foo
+- ↑ CONTENT
+
+
+!! end
+
!! test
Error conditions on non-visible content
!! wikitext
@@ -758,7 +836,7 @@ Error conditions on non-visible content
[ ]
-!! html
+!! html/php
[1]
[2]
[3]
@@ -773,6 +851,11 @@ Error conditions on non-visible content
Cite error: <ref>
tag defined in <references>
with name "b" has no content.
Cite error: <ref>
tag defined in <references>
with name "c" has no content.
+!! html/parsoid
+[1]
+[2]
+[3]
+- ↑ x
- ↑
- ↑
!! end
!! article
@@ -856,30 +939,85 @@ foo
[ with no name and no content.
!! wikitext
Bla.]
-!! html
+foo.
+zero{{1x|}}
+
+!! html/php
Bla.Cite error: Invalid <ref>
tag; refs with no name must have content
+foo.Cite error: The opening <ref>
tag is malformed or has a bad name
+zeroCite error: The opening <ref>
tag is malformed or has a bad name
+!! html/parsoid
+Bla.[1]
+foo.[2]
+zero[3]
+- ↑
- ↑
- ↑
!! end
!! test
[ with an empty-string name parameter and no content.
!! wikitext
Bla.][ ]
-!! html
+
+!! html/php
Bla.Cite error: Invalid <ref>
tag; refs with no name must have content
+!! html/parsoid
+Bla.[1]
+- ↑
+!! end
+
+!! test
+[ with whitespace only name parameter and no content.
+!! options
+parsoid=wt2html
+!! wikitext
+Hi ][ ]
+Ho
+!! html/php
+Hi Cite error: Invalid <ref>
tag; refs with no name must have content
+Ho Cite error: The opening <ref>
tag is malformed or has a bad name
+
+!! html/parsoid
+Hi [1]
+Ho [2]
+- ↑
- ↑
!! end
!! test
[ with a non-empty name parameter and no content.
!! wikitext
Bla.][ ]
-!! html
+
+!! html/php
Bla.[1]
- ↑ Cite error: Invalid
<ref>
tag; no text was provided for refs named void
+!! html/parsoid
+Bla.[1]
+- ↑
+!! end
+
+!! test
+Whitespace only doesn't set content for named ref
+!! wikitext
+Hi [ ]
+Hi [Off to work we go!]
+
+!! html/php
+Hi [1]
+Hi [1]
+
+
+- ↑ 1.0 1.1 Off to work we go!
+
+
+!! html/parsoid
+Hi [1]
+Hi [1]
+- 1 2 Off to work we go!
!! end
!! test
@@ -888,7 +1026,7 @@ Multiple definition (outside )
[abc]
[def]
-!! html
+!! html/php
[1]
[1]
@@ -896,6 +1034,10 @@ Multiple definition (outside )
↑ 1.0 1.1 abc Cite error: Invalid <ref>
tag; name "a" defined multiple times with different content
+!! html/parsoid
+[1]
+[1]
+- 1 2 abc
!! end
!! test
@@ -906,13 +1048,16 @@ Multiple definition (inside )
[abc]
[def]
-!! html
+!! html/php
[1]
- ↑ abc Cite error: Invalid
<ref>
tag; name "a" defined multiple times with different content
+!! html/parsoid
+[1]
+- ↑ abc
!! end
!! test
@@ -922,13 +1067,16 @@ Multiple definition (mixed outside/inside)
[def]
-!! html
+!! html/php
[1]
- ↑ abc Cite error: Invalid
<ref>
tag; name "a" defined multiple times with different content
+!! html/parsoid
+[1]
+- ↑ abc
!! end
!! test
@@ -939,13 +1087,21 @@ Multiple definition (inside {{#tag:references}})
[abc]
[def]
}}
-!! html
+
+!! html/php
[1]
- ↑ abc Cite error: Invalid
<ref>
tag; name "a" defined multiple times with different content
+!! html/parsoid
+[1]
+
+[1]
+[1]
+
+- 1 2 3 abc
!! end
# Parsoid doesn't rt cleanly because name attribute is actually broken
@@ -986,7 +1142,7 @@ wgFragmentMode=[ 'html5' ]
!! html/parsoid
[1]
-- ↑ [bar]
+- ↑ [bar]
!! end
@@ -1004,14 +1160,10 @@ B [foo]
C
!! html/parsoid
-A [1]
-B [2]
-C [3]
-
-- ↑ foo
-- ↑ foo
-- ↑
-
+A [1]
+B [2]
+C [3]
+- ↑ foo
- ↑ foo
- ↑
!! end
!! test
@@ -1192,8 +1344,8 @@ Ref: 12. ref-tags act as trailing newline migration barrier
!! wikitext
a
-b
-
+b [foo]
+[bar]
c
@@ -1201,13 +1353,13 @@ c
a
-b [1]
-[2]
+b [1]
+[2]
c
-- ↑
-- ↑
+↑ foo
+↑ bar
!! end
!! test
@@ -1239,7 +1391,7 @@ parsoid=wt2html
!! html/parsoid
[1] baz</ref>
-- ↑ foo <ref>bar
+- ↑ foo <ref>bar
!! end
!! test
@@ -1348,7 +1500,7 @@ C
!! html/parsoid
A [1]
-B [1]
+B [1]
C [1]
- 1 2 3 Foo one
@@ -1535,17 +1687,56 @@ B
[foo]
!! html/parsoid
-A [1]
-B [X 1]
-
+A [1]
+B [X 1]
-
-- ↑ foo bar for a
-
+- ↑ foo bar for a
-
-- ↑ foo
-
+- ↑ foo
+!! end
+
+!! test
+References: 7b. Multiple references tags some with errors should be correctly handled
+!! wikitext
+ALPHA
+BETA
+ONE
+TWO[food]
+
+
+THREE[CONTENT]
+FOUR
+FIVE
+SIX
+
+
+[NOGROUPCONTENT]
+
+SEVEN
+EIGHT
+
+NINE[NINECONTENT]
+TEN[TENCONTENT]
+
+!! html/parsoid
+ALPHA[1]
+BETA[1]
+ONE[NOTES 1]
+TWO[NOTES 1]
+- 1 2 food
+- 1 2
+THREE[NOTES 1]
+FOUR[NOTES 2]
+FIVE[NOTES 2]
+SIX[1]
+- ↑ CONTENT
- 1 2
+- ↑ NOGROUPCONTENT
+SEVEN[NOTES 1]
+EIGHT[NOTES 2]
+- ↑
- ↑
+NINE[NOTES 1]
+TEN[NOTES 2]
+- ↑ NINECONTENT
- ↑ TENCONTENT
!! end
!! test
@@ -2008,7 +2199,7 @@ Similarly named refs with identical bodies
!! html/parsoid
1 [1] 2 [1]
-- 1 2 1
+- 1 2 1
!! end
!! test
@@ -2027,7 +2218,7 @@ wgFragmentMode=['html5']
!! html/parsoid
[1]
-- ↑ [bar]
+- ↑ [bar]
!! end
!! test
@@ -2046,7 +2237,7 @@ wgFragmentMode=['legacy']
!! html/parsoid
[1]
-- ↑ [bar]
+- ↑ [bar]
!! end
## Just a regression test
@@ -2143,7 +2334,7 @@ Serialize reference tags by themselves on a line
!! options
parsoid=html2wt
!! html/parsoid
-hi [1]
hi ho
+hi [1]
hi ho
!! wikitext
hi [ho]