From: Jeff Godin Date: Mon, 23 Apr 2012 12:05:02 +0000 (-0400) Subject: Don't change & to &Amp;, etc. X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=eab4ff612b15f9f199adf15ed4194f53e5deedaa;p=evergreen%2Ftadl.git Don't change & to &Amp;, etc. Fix toTitleCase() to not uppercase HTML character entities. Signed-off-by: Jeff Godin --- diff --git a/Open-ILS/web/opac/skin/tadlv4/js/grpl_utils.js b/Open-ILS/web/opac/skin/tadlv4/js/grpl_utils.js index 03af07d6d2..dc63a5a2d7 100644 --- a/Open-ILS/web/opac/skin/tadlv4/js/grpl_utils.js +++ b/Open-ILS/web/opac/skin/tadlv4/js/grpl_utils.js @@ -32,6 +32,9 @@ String.prototype.toTitleCase = function () { var smallWords = /^(a|an|and|as|at|but|by|en|for|if|in|of|on|or|the|to|vs?\.?|via)$/i; return this.replace(/([^\W_]+[^\s-]*) */g, function (match, p1, index, title) { + if (title.charAt(index - 1) == '&') { + return match; + } if (index > 0 && index + p1.length !== title.length && p1.search(smallWords) > -1 && title.charAt(index - 2) !== ":" && title.charAt(index - 1).search(/[^\s-]/) < 0) {