mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-15 02:23:58 +00:00
Strip all wikilinks for initial edit summary
The regex that removes the wikilinks to create the initial edit summary should have the global flag since it was taken from preg_replace which replaces globally implicitly. Bug: T276722 Change-Id: I21e3cdfe752657ad37d9a6bd473a7e7dbb6e4cd6
This commit is contained in:
parent
013d5068c2
commit
73adc9ac78
|
@ -1917,9 +1917,9 @@ ve.init.mw.ArticleTarget.prototype.restoreEditSection = function () {
|
|||
// Extract the title
|
||||
.replace( /^\s*=+\s*(.*?)\s*=+\s*$/, '$1' )
|
||||
// Remove links
|
||||
.replace( /\[\[:?([^[|]+)\|([^[]+)\]\]/, '$2' )
|
||||
.replace( /\[\[:?([^[]+)\|?\]\]/, '$1' )
|
||||
.replace( new RegExp( '\\[(?:' + ve.init.platform.getUnanchoredExternalLinkUrlProtocolsRegExp().source + ')([^ ]+?) ([^\\[]+)\\]', 'i' ), '$3' )
|
||||
.replace( /\[\[:?([^[|]+)\|([^[]+)\]\]/g, '$2' )
|
||||
.replace( /\[\[:?([^[]+)\|?\]\]/g, '$1' )
|
||||
.replace( new RegExp( '\\[(?:' + ve.init.platform.getUnanchoredExternalLinkUrlProtocolsRegExp().source + ')([^ ]+?) ([^\\[]+)\\]', 'ig' ), '$3' )
|
||||
// Cheap HTML removal
|
||||
.replace( /<[^>]+?>/g, '' );
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue