[Pkg-javascript-commits] [node-entities] 37/63: add TODO notice for handling non-BMP numeric entities

Wolfgang Borgert debacle at moszumanska.debian.org
Mon Sep 22 08:15:47 UTC 2014


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

debacle pushed a commit to branch master
in repository node-entities.

commit 0ef67461c15011e44e165c72d10dc02eb7ad6e25
Author: fb55 <me at feedic.com>
Date:   Sun Feb 16 21:09:24 2014 +0100

    add TODO notice for handling non-BMP numeric entities
---
 index.js | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/index.js b/index.js
index d7ac72b..8470541 100644
--- a/index.js
+++ b/index.js
@@ -40,14 +40,18 @@ function getReplacer(obj){
 	return function normalReplacer(name){
 		if(name.charAt(1) === "#"){
 			if(name.charAt(2).toLowerCase() === "x"){
-				return String.fromCharCode(parseInt(name.substr(3), 16));
+				return codePointToSymbol(parseInt(name.substr(3), 16));
 			}
-			return String.fromCharCode(parseInt(name.substr(2), 10));
+			return codePointToSymbol(parseInt(name.substr(2), 10));
 		}
 		return obj[name.substr(1)];
 	};
 }
 
+function codePointToSymbol(entity){
+	return String.fromCharCode(entity); //TODO
+}
+
 function getStrictReplacer(obj){
 	return function strictReplacer(name){
 		if(name.charAt(1) === "#"){

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



More information about the Pkg-javascript-commits mailing list