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

This commit is contained in:
jenkins-bot 2015-10-14 00:31:07 +00:00 committed by Gerrit Code Review
commit eaf71a1d4b

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() + '>';