From eab4ff612b15f9f199adf15ed4194f53e5deedaa Mon Sep 17 00:00:00 2001 From: Jeff Godin Date: Mon, 23 Apr 2012 08:05:02 -0400 Subject: [PATCH] Don't change & to &Amp;, etc. Fix toTitleCase() to not uppercase HTML character entities. Signed-off-by: Jeff Godin --- Open-ILS/web/opac/skin/tadlv4/js/grpl_utils.js | 3 +++ 1 file changed, 3 insertions(+) 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) { -- 2.11.0