ext.popups.renderer.article.js: Use mw.RegExp.escape() for RegExp escaping

mw.RegExp.escape() is already used in ext.popups.core.js and
the dependency to module 'mediawiki.RegExp' is set.

Change-Id: Iaa7ab6902693c787234fd589276fa38ce75b82da
This commit is contained in:
Fomafix 2015-10-02 20:58:26 +00:00 committed by [[mw:User:Fomafix]]
parent 486e34fb38
commit 7ac7a2abd1

View file

@ -169,7 +169,7 @@
*/
article.getProcessedElements = function ( extract, title ) {
var elements = [],
escapedTitle = title.replace( /([.?*+^$[\]\\(){}|-])/g, '\\$1' ), // Escape RegExp elements
escapedTitle = mw.RegExp.escape( title ), // Escape RegExp elements
regExp = new RegExp( '(^|\\s)(' + escapedTitle + ')(|$)', 'ig' ),
boldIdentifier = '<bi-' + Math.random() + '>',
snip = '<snip-' + Math.random() + '>';