Pmiazga has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/397568 )

Change subject: Definition list should be also moved with first paragraph
......................................................................

Definition list should be also moved with first paragraph

Change-Id: I063d506a10b310d40d498a8fb4227ea316c9d904
---
M includes/MobileFormatter.php
M tests/phpunit/MobileFormatterTest.php
2 files changed, 14 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/68/397568/1

diff --git a/includes/MobileFormatter.php b/includes/MobileFormatter.php
index 938f90b..e092b10 100644
--- a/includes/MobileFormatter.php
+++ b/includes/MobileFormatter.php
@@ -274,7 +274,7 @@
                                $elementAfterParagraphQuery = $xPath->query( 
'following-sibling::*[1]', $firstP );
                                if ( $elementAfterParagraphQuery->length > 0 ) {
                                        $elem = 
$elementAfterParagraphQuery->item( 0 );
-                                       if ( $elem->tagName === 'ol' || 
$elem->tagName === 'ul' ) {
+                                       if ( in_array( $elem->tagName, [ 'ol', 
'ul', 'dl' ] ) ) {
                                                $listElementAfterParagraph = 
$elem;
                                        }
                                }
diff --git a/tests/phpunit/MobileFormatterTest.php 
b/tests/phpunit/MobileFormatterTest.php
index 3974697..7cb33f8 100644
--- a/tests/phpunit/MobileFormatterTest.php
+++ b/tests/phpunit/MobileFormatterTest.php
@@ -617,6 +617,19 @@
                                $enableSections, false, false, false, true,
                        ],
                        [
+                               // infobox, a paragraph, definition list element
+                               '<table class="' . self::INFOBOX_CLASSNAME . 
'"><tr><td>infobox</td></tr></table>' .
+                               '<p>paragraph</p>' .
+                               '<dl><dt>Item</dt><dd>description</dd></dl>',
+
+                               $this->makeSectionHtml(
+                                       0,
+                                       
'<dl><dt>Item</dt><dd>description</dd></dl>' .
+                                       '<table class="' . 
self::INFOBOX_CLASSNAME . '"><tr><td>infobox</td></tr></table>'
+                               ),
+                               $enableSections, false, false, false, true,
+                       ],
+                       [
                                // 2 hat-notes, ambox, 2 infoboxes, 2 
paragraphs, another section
                                '<div class="' . self::HATNOTE_CLASSNAME . 
'">hatnote</div>' .
                                '<div class="' . self::HATNOTE_CLASSNAME . 
'">hatnote</div>' .

-- 
To view, visit https://gerrit.wikimedia.org/r/397568
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I063d506a10b310d40d498a8fb4227ea316c9d904
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Pmiazga <pmia...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to