From 8539f75b546504b8a040368235bdaaf82f20ac78 Mon Sep 17 00:00:00 2001 From: "James D. Forrester" Date: Tue, 6 Oct 2020 12:17:30 -0700 Subject: [PATCH] MWCategoryMetaItem: Allow trailing whitespace (e.g. \n) in category names Encountered on a page with [[d:Template:Translation_categories]]. Change-Id: Ib2df3518e3047d32626a156c32d5ef9e37ea9b3a --- modules/ve-mw/dm/metaitems/ve.dm.MWCategoryMetaItem.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ve-mw/dm/metaitems/ve.dm.MWCategoryMetaItem.js b/modules/ve-mw/dm/metaitems/ve.dm.MWCategoryMetaItem.js index e593b31c8a..8b084315f5 100644 --- a/modules/ve-mw/dm/metaitems/ve.dm.MWCategoryMetaItem.js +++ b/modules/ve-mw/dm/metaitems/ve.dm.MWCategoryMetaItem.js @@ -36,7 +36,7 @@ ve.dm.MWCategoryMetaItem.static.toDataElement = function ( domElements ) { var href = domElements[ 0 ].getAttribute( 'href' ), data = mw.libs.ve.parseParsoidResourceName( href ), rawTitleAndFragment = data.rawTitle.match( /^(.*?)(?:#(.*))?$/ ), - titleAndFragment = data.title.match( /^(.*?)(?:#(.*))?$/ ); + titleAndFragment = data.title.match( /^(.*?)(?:#(.*))?\s*$/ ); return { type: this.name, attributes: {