[Pkg-javascript-commits] [dojo] 02/04: Normalize whitespace/nbsp handling for currency. Thanks, rauldiaz, for flagging this. Fixes #8036

David Prévot taffit at moszumanska.debian.org
Mon May 11 20:12:11 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to annotated tag 1.2.2
in repository dojo.

commit 9c342413d6abbceb6e5b57695e655ea15e1434fc
Author: Adam Peller <github at peller.org>
Date:   Sun Nov 16 03:34:22 2008 +0000

    Normalize whitespace/nbsp handling for currency.  Thanks, rauldiaz, for flagging this. Fixes #8036
    
    git-svn-id: http://svn.dojotoolkit.org/src/branches/1.2/dojo@15711 560b804f-0ae3-0310-86f3-f6aa0a117693
---
 number.js | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/number.js b/number.js
index 38f8911..8d869e5 100644
--- a/number.js
+++ b/number.js
@@ -333,11 +333,11 @@ dojo.number._parseInfo = function(/*Object?*/options){
 
 	if(isCurrency){
 		// substitute the currency symbol for the placeholder in the pattern
-		re = re.replace(/(\s*)(\u00a4{1,3})(\s*)/g, function(match, before, target, after){
+		re = re.replace(/([\s\xa0]*)(\u00a4{1,3})([\s\xa0]*)/g, function(match, before, target, after){
 			var prop = ["symbol", "currency", "displayName"][target.length-1];
 			var symbol = dojo.regexp.escapeString(options[prop] || options.currency || "");
-			before = before ? "\\s" : "";
-			after = after ? "\\s" : "";
+			before = before ? "[\\s\\xa0]" : "";
+			after = after ? "[\\s\\xa0]" : "";
 			if(!options.strict){
 				if(before){before += "*";}
 				if(after){after += "*";}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/dojo.git



More information about the Pkg-javascript-commits mailing list