HomePhabricator

ve.ui.MWDefinedTransclusionContextItem: Fix handling of template names

Authored by matmarex on Oct 7 2019, 12:53 PM.

Description

ve.ui.MWDefinedTransclusionContextItem: Fix handling of template names

The ...target.wt property contains the wikitext used to generate
the template name. It can contain trailing newlines (T234817) and
all kinds of funny wikitext syntax. Instead, use ...target.href,
which is the title of the page that is actually transcluded. Compare
the new code to ve.dm.MWTransclusionNode.prototype.getPartsList.

Additionally, fix some confusion about namespaces (treating template
names as titles in the main namespace). The template names in the
configuration page (visualeditor-template-tools-definition.json)
now support overriding namespaces in the same way as in wikitext.

Bug: T234817
Change-Id: I7c557d28e961d0b9117fc0380c65cdd42035ae96
(cherry picked from commit 55aec8f977d8133f5e20595ecf1db2b2f8d19835)

Details