diff --git a/src/ReferenceStack.php b/src/ReferenceStack.php index b1a333521..0106dca60 100644 --- a/src/ReferenceStack.php +++ b/src/ReferenceStack.php @@ -343,8 +343,7 @@ class ReferenceStack { case 'new': // Rollback the addition of new elements to the stack unset( $this->refs[$group][$lookup] ); - if ( $this->refs[$group] === [] ) { - // TODO: Unsetting is unecessary. + if ( !$this->refs[$group] ) { $this->popGroup( $group ); } // TODO: else, don't we need to decrement groupRefSequence? diff --git a/tests/parser/citeParserTests.txt b/tests/parser/citeParserTests.txt index f454b78ed..bba75a68b 100644 --- a/tests/parser/citeParserTests.txt +++ b/tests/parser/citeParserTests.txt @@ -2037,6 +2037,27 @@ T242437 - Blank ref name in #tag regression

!! end +!! test +Numbers in the default group need to start with 1, independent from other groups +!! wikitext + +{{#tag:references| +a +|group=g}} +c +!! html +

[g 1] +

+
    +
  1. a +
  2. +
+[1]
    +
  1. c +
  2. +
+!! end + !! test Serialize reference tags by themselves on a line !! options