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

Change subject: Properly transclude sections inside extension tags
......................................................................

Properly transclude sections inside extension tags

Bug: T163411
Change-Id: I16dc9e1a63c7dab4f57bc6e6481e15ea037896b5
---
M LabeledSectionTransclusion.class.php
1 file changed, 15 insertions(+), 0 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/LabeledSectionTransclusion
 refs/changes/56/349256/1

diff --git a/LabeledSectionTransclusion.class.php 
b/LabeledSectionTransclusion.class.php
index f4ae2c6..08486f7 100644
--- a/LabeledSectionTransclusion.class.php
+++ b/LabeledSectionTransclusion.class.php
@@ -386,6 +386,21 @@
                                                        $found = true;
                                                        break;
                                                }
+                                       } else {
+                                               // If we're inside another 
extension tag (such as <poem> or <ref>), look inside (bug T163411)
+                                               $dom = 
$parser->preprocessToDom( $parts['inner'] );
+                                               $child = $dom->getFirstChild();
+                                               if ( $child->getName() === 
'ext' ) {
+                                                       $childParts = 
$child->splitExt();
+                                                       $childParts = 
array_map( array( $newFrame, 'expand' ), $childParts );
+                                                       if ( self::isSection( 
$childParts['name'] ) ) {
+                                                               if ( 
preg_match( $beginRegex, $childParts['attr'] ) ) {
+                                                                       $found 
= true;
+                                                                       $node = 
$child;
+                                                                       break;
+                                                               }
+                                                       }
+                                               }
                                        }
                                }
                                if ( !$found || !$node ) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I16dc9e1a63c7dab4f57bc6e6481e15ea037896b5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/LabeledSectionTransclusion
Gerrit-Branch: master
Gerrit-Owner: Sophivorus <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to