From f113fb1bf1f53d6b45db65e972d1ff35e206a16d Mon Sep 17 00:00:00 2001 From: Francis Crick Date: Sun, 5 Mar 2017 18:27:21 -0800 Subject: [PATCH] fixing an issue where _xd_ is getting escaped --- bits/22_xmlutils.js | 3 ++- ods.flow.js | 3 ++- ods.js | 3 ++- odsbits/22_xmlutils.js | 3 ++- xlsx.flow.js | 3 ++- xlsx.js | 3 ++- 6 files changed, 12 insertions(+), 6 deletions(-) diff --git a/bits/22_xmlutils.js b/bits/22_xmlutils.js index 300cfcd..1d4d9cd 100644 --- a/bits/22_xmlutils.js +++ b/bits/22_xmlutils.js @@ -32,7 +32,8 @@ var rencstr = "&<>'\"".split(""); // TODO: CP remap (need to read file version to determine OS) var unescapexml/*:StringConv*/ = (function() { - var encregex = /&[a-z]*;/g, coderegex = /_x([\da-fA-F]+)_/g; + /* 22.4.2.4 bstr (Basic String) */ + var encregex = /&[a-z]*;/g, coderegex = /_x([\da-fA-F]{4})_/g; return function unescapexml(text/*:string*/)/*:string*/ { var s = text + ''; return s.replace(encregex, function($$) { return encodings[$$]; }).replace(coderegex,function(m,c) {return String.fromCharCode(parseInt(c,16));}); diff --git a/ods.flow.js b/ods.flow.js index 29b52e5..4d9b761 100644 --- a/ods.flow.js +++ b/ods.flow.js @@ -116,7 +116,8 @@ var rencoding = { var rencstr = "&<>'\"".split(""); // TODO: CP remap (need to read file version to determine OS) -var encregex = /&[a-z]*;/g, coderegex = /_x([\da-fA-F]+)_/g; +/* 22.4.2.4 bstr (Basic String) */ +var encregex = /&[a-z]*;/g, coderegex = /_x([\da-fA-F]{4})_/g; function unescapexml(text){ var s = text + ''; return s.replace(encregex, function($$) { return encodings[$$]; }).replace(coderegex,function(m,c) {return String.fromCharCode(parseInt(c,16));}); diff --git a/ods.js b/ods.js index 3f62c2d..0920378 100644 --- a/ods.js +++ b/ods.js @@ -114,7 +114,8 @@ var rencoding = { var rencstr = "&<>'\"".split(""); // TODO: CP remap (need to read file version to determine OS) -var encregex = /&[a-z]*;/g, coderegex = /_x([\da-fA-F]+)_/g; +/* 22.4.2.4 bstr (Basic String) */ +var encregex = /&[a-z]*;/g, coderegex = /_x([\da-fA-F]{4})_/g; function unescapexml(text){ var s = text + ''; return s.replace(encregex, function($$) { return encodings[$$]; }).replace(coderegex,function(m,c) {return String.fromCharCode(parseInt(c,16));}); diff --git a/odsbits/22_xmlutils.js b/odsbits/22_xmlutils.js index 3631d37..9a99a54 100644 --- a/odsbits/22_xmlutils.js +++ b/odsbits/22_xmlutils.js @@ -44,7 +44,8 @@ var rencoding = { var rencstr = "&<>'\"".split(""); // TODO: CP remap (need to read file version to determine OS) -var encregex = /&[a-z]*;/g, coderegex = /_x([\da-fA-F]+)_/g; +/* 22.4.2.4 bstr (Basic String) */ +var encregex = /&[a-z]*;/g, coderegex = /_x([\da-fA-F]{4})_/g; function unescapexml(text){ var s = text + ''; return s.replace(encregex, function($$) { return encodings[$$]; }).replace(coderegex,function(m,c) {return String.fromCharCode(parseInt(c,16));}); diff --git a/xlsx.flow.js b/xlsx.flow.js index b82e543..a4df63a 100644 --- a/xlsx.flow.js +++ b/xlsx.flow.js @@ -1457,7 +1457,8 @@ var rencstr = "&<>'\"".split(""); // TODO: CP remap (need to read file version to determine OS) var unescapexml/*:StringConv*/ = (function() { - var encregex = /&[a-z]*;/g, coderegex = /_x([\da-fA-F]+)_/g; + /* 22.4.2.4 bstr (Basic String) */ + var encregex = /&[a-z]*;/g, coderegex = /_x([\da-fA-F]{4})_/g; return function unescapexml(text/*:string*/)/*:string*/ { var s = text + ''; return s.replace(encregex, function($$) { return encodings[$$]; }).replace(coderegex,function(m,c) {return String.fromCharCode(parseInt(c,16));}); diff --git a/xlsx.js b/xlsx.js index d592390..54d7cf8 100644 --- a/xlsx.js +++ b/xlsx.js @@ -1415,7 +1415,8 @@ var rencstr = "&<>'\"".split(""); // TODO: CP remap (need to read file version to determine OS) var unescapexml = (function() { - var encregex = /&[a-z]*;/g, coderegex = /_x([\da-fA-F]+)_/g; + /* 22.4.2.4 bstr (Basic String) */ + var encregex = /&[a-z]*;/g, coderegex = /_x([\da-fA-F]{4})_/g; return function unescapexml(text) { var s = text + ''; return s.replace(encregex, function($$) { return encodings[$$]; }).replace(coderegex,function(m,c) {return String.fromCharCode(parseInt(c,16));});