diff --git a/src/Cite.php b/src/Cite.php index efc50faa5..fe6ff4aba 100644 --- a/src/Cite.php +++ b/src/Cite.php @@ -498,7 +498,6 @@ class Cite { return $this->referencesFormatter->formatReferences( $parser, $this->referenceStack->popGroup( $group ), - // FIXME: The responsive feature is not covered by parser tests! (bool)( $responsive ?? $wgCiteResponsiveReferences ), $this->isSectionPreview ); diff --git a/tests/parser/responsiveReferences.txt b/tests/parser/responsiveReferences.txt new file mode 100644 index 000000000..04387d1a9 --- /dev/null +++ b/tests/parser/responsiveReferences.txt @@ -0,0 +1,173 @@ +!! test +Ordered lists directly following each other should not be merged +!! config +wgCiteResponsiveReferences=false +!! wikitext +reference text +# content list item + +!! html/php +

[1] +

+
  1. content list item
+
    +
  1. reference text +
  2. +
+!! end + +!! test +Enabling responsive references by default should add a
wrapper +!! config +wgCiteResponsiveReferences=true +!! wikitext +a + +!! html/php +

[1] +

+
    +
  1. a +
  2. +
+!! end + +!! test +Enabling responsive references in the tag should add a
wrapper +!! config +wgCiteResponsiveReferences=false +!! wikitext +a + +!! html/php +

[1] +

+
    +
  1. a +
  2. +
+!! end + +!! test +Disabling responsive references in the tag should remove the
wrapper +!! config +wgCiteResponsiveReferences=true +!! wikitext +a + +!! html/php +

[1] +

+
    +
  1. a +
  2. +
+!! end + +!! test +9 references should *not* enable the column mode +!! config +wgCiteResponsiveReferences=true +!! wikitext +a +a +a +a +a +a +a +a +a +a + +!! html/php +

[1] +[2] +[3] +[4] +[5] +[6] +[7] +[8] +[9] +[10] +

+
    +
  1. a +
  2. +
  3. a +
  4. +
  5. a +
  6. +
  7. a +
  8. +
  9. a +
  10. +
  11. a +
  12. +
  13. a +
  14. +
  15. a +
  16. +
  17. a +
  18. +
  19. a +
  20. +
+!! end + +!! test +10 references should enable the column mode +!! config +wgCiteResponsiveReferences=true +!! wikitext +a +a +a +a +a +a +a +a +a +a +a + +!! html/php +

[1] +[2] +[3] +[4] +[5] +[6] +[7] +[8] +[9] +[10] +[11] +

+
    +
  1. a +
  2. +
  3. a +
  4. +
  5. a +
  6. +
  7. a +
  8. +
  9. a +
  10. +
  11. a +
  12. +
  13. a +
  14. +
  15. a +
  16. +
  17. a +
  18. +
  19. a +
  20. +
  21. a +
  22. +
+!! end