summaryrefslogtreecommitdiff
path: root/misc/drupal.js
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2006-05-29 14:22:31 +0000
committerDries Buytaert <dries@buytaert.net>2006-05-29 14:22:31 +0000
commitc3324b9a5049f0e8152fbc57e624a685621aa16c (patch)
treeb7f6a0cac135fd29838fa5f77e1297f275a81598 /misc/drupal.js
parent1eca161b688d4245bff6b5aa0c60ff5257a5b764 (diff)
downloadbrdo-c3324b9a5049f0e8152fbc57e624a685621aa16c.tar.gz
brdo-c3324b9a5049f0e8152fbc57e624a685621aa16c.tar.bz2
- Patch #58956 by timcn: prevent multiple class names from being glued together.
Diffstat (limited to 'misc/drupal.js')
-rw-r--r--misc/drupal.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/misc/drupal.js b/misc/drupal.js
index e697fc855..6bbe8fc74 100644
--- a/misc/drupal.js
+++ b/misc/drupal.js
@@ -259,7 +259,8 @@ function removeClass(node, className) {
if (!hasClass(node, className)) {
return false;
}
- node.className = eregReplace('(^| )'+ className +'($| )', '', node.className);
+ // Replaces words surrounded with whitespace or at a string border with a space. Prevents multiple class names from being glued together.
+ node.className = eregReplace('(^|\\s+)'+ className +'($|\\s+)', ' ', node.className);
return true;
}