Krinkle has uploaded a new change for review.
https://gerrit.wikimedia.org/r/64867
Change subject: MWLinkTargetInputWidget: Normalise value before matching
......................................................................
MWLinkTargetInputWidget: Normalise value before matching
Don't suggest a "new page" (redlink) for values that are
strictly different but the same as a suggestion according
to mw.Title (e.g. input "foo" with an existing "Foo" page
should not suggest a redlink to inexistant page "foo").
Bug: 48476
Change-Id: I66f5fc56554984af58d6223dc6cd76b3ab9940bd
---
M modules/ve/ui/widgets/ve.ui.MWLinkTargetInputWidget.js
1 file changed, 5 insertions(+), 1 deletion(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor
refs/changes/67/64867/1
diff --git a/modules/ve/ui/widgets/ve.ui.MWLinkTargetInputWidget.js
b/modules/ve/ui/widgets/ve.ui.MWLinkTargetInputWidget.js
index b427020..1df82f4 100644
--- a/modules/ve/ui/widgets/ve.ui.MWLinkTargetInputWidget.js
+++ b/modules/ve/ui/widgets/ve.ui.MWLinkTargetInputWidget.js
@@ -115,7 +115,11 @@
}
// Internal link
- if ( !pageExists && ( !matchingPages || matchingPages.indexOf(
this.value ) === -1 ) ) {
+ if ( !pageExists && ( !matchingPages ||
+ // Run value through mw.Title to avoid treating a match as a
mismatch where
+ // normalisation would make them matching (bug 48476)
+ matchingPages.indexOf( new mw.Title( this.value ).toString() )
=== -1
+ ) ) {
items.push( new ve.ui.MenuSectionItemWidget(
'newPage',
{ '$$': menu$$, 'label': ve.msg(
'visualeditor-linkinspector-suggest-new-page' ) }
--
To view, visit https://gerrit.wikimedia.org/r/64867
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I66f5fc56554984af58d6223dc6cd76b3ab9940bd
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Krinkle <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits