MobileFormatter: Do not scrub elements on pages in template namespace

This task is about the MobileFrontend extension of MediaWiki.

Scrubbing elements on template pages MobileFormatter::filterContent can cause confusion to editors. For example which features a navbox and no other HTML shows as an empty page!

What you have to do:

Do not apply the MobileFormatter transformation to content in the template namespace. To do this we will update the logic in the hook that transforms the content. The new logic should be configurable so we can exclude other namespaces in future. We'll add a config variable called wgMFMobileFormatterNamespaceBlacklist which should default to [ NS_TEMPLATE, NS_SPECIAL ]. This will allow us to add other namespaces easily if necessary.

For extra points and kudos the isSpecialPage checks inside should be no longer necessary as a result of this change. Please remove this code in a separate follow up to your change. Good work!

You are expected to provide a patch in Wikimedia Gerrit. See for how to set up Git and Gerrit.

Task tags

  • php

Students who completed this task


Task type

  • code Code