Steps to replicate the issue (include links if applicable):
- Visit https://en.m.wikivoyage.org/wiki/Costa_Maya?useparsoid=1&debug=1
- View source
What happens?:
The entire article is wrapped in a section element with class="mf-section-0" and class="mf-section-1"
This impacts editors who have added site specific rules to target the lead paragraph.
What should have happened instead?:
This wrapping section is not needed and shouldn't be there. The HTML hierarchy should be identical to the desktop site.
To fix this we should update MakeSectionsTransform so that it doesn't apply to Parsoid content. It can do this by checking for the presence of the data-mw-parsoid-version attribute. We already do this in includes/Transforms/LazyImageTransform.php
Please add a test!
Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia):
Other information (browser name/version, screenshots, etc.):
QA steps
- Confirm that there is no wrapping section
- Confirm that the lazy image transform has not been impacted and that first section images are never lazy loaded.
Derived Requirement
Ensure that Parsoid content on the mobile version of Wikivoyage articles does not contain unnecessary wrapping section elements (mf-section-0 and mf-section-1), and verify that the lazy image transform remains unaffected.
BDD
Feature: Correct HTML hierarchy for Parsoid content on mobile Wikivoyage
Scenario: Ensure Parsoid content is not wrapped in unnecessary section elements
Given the user is viewing a Wikivoyage article using Parsoid content on the mobile site When the article is rendered Then no unnecessary wrapping section elements (class="mf-section-0" and class="mf-section-1") should be present And the lazy image transform should remain unaffected
Test Steps
Test Case 1: Ensure no unnecessary section wrapping in Parsoid content on the mobile Wikivoyage article
Open the Wikivoyage article for Costa Maya here.
View the source of the page.
✅❓❌⬜ AC1: Confirm that there are no section elements with class="mf-section-0" and class="mf-section-1" wrapping the article's content.
Test Case 2: Ensure lazy image transform is not impacted for first section images
Verify that images in the first section of the article are not lazy-loaded.
✅❓❌⬜ AC2: Confirm that the lazy image transform is functioning correctly, and images in the first section are not lazy-loaded.
QA Results - Wikivoyage PROD
| AC | Status | Details |
|---|---|---|
| 1 | ✅ | T374578#10173451 |
| 2 | ✅ | T374578#10173451 |


