r80424 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r80423‎ | r80424 | r80425 >
Date:20:50, 16 January 2011
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Fixed regex to work for scentances as opossed to only words
Modified paths:
  • /trunk/extensions/LiveTranslate/includes/ext.livetranslate.js (modified) (history)

Diff [purge]

Index: trunk/extensions/LiveTranslate/includes/ext.livetranslate.js
@@ -174,7 +174,7 @@
175175 function insertNoTranslateTags( words ) {
176176 for ( i in words ) {
177177 $( '#bodyContent *' ).replaceText(
178 - new RegExp( "\\b" + RegExp.escape( words[i] ) + "\\b", "g" ),
 178+ new RegExp( "(\\W)*" + RegExp.escape( words[i] ) + "(\\W)*", "g" ),
179179 function( str ) {
180180 return '<span class="notranslate">' + str + '</span>'
181181 }

Status & tagging log