Fix RegExp used to remove existing line classes #15

Merged
merged 2 commits into from Jan 7, 2012
Jump to file
+1 −1
Split
View
@@ -111,7 +111,7 @@
$t.find(childSelector).addClass(function(lineNumber, className)
{
// remove existing line classes.
- return [className.replace(new RegExp('\\s*' + BigText.LINE_CLASS_PREFIX + '\\d+'), ''),
+ return [className.replace(new RegExp('\\b' + BigText.LINE_CLASS_PREFIX + '\\d+\\b'), ''),
BigText.LINE_CLASS_PREFIX + lineNumber].join(' ');
});