Skip to content

Commit 54f380e

Browse files
Hugh GreenishSheetJSDev
Hugh Greenish
authored andcommitted
new tag regex handles angle brackets in attributes
fixes #768
1 parent d443860 commit 54f380e

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

bits/22_xmlutils.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
var attregexg=/([^"\s?>\/]+)=((?:")([^"]*)(?:")|(?:')([^']*)(?:')|([^'">\s]+))/g;
2-
var tagregex=/<[^>]*>/g;
2+
var tagregex=/<[\/\?]?[a-zA-Z0-9:]+(?:\s+[^"\s?>\/]+=(?:"[^"]*"|'[^']*'|[^'">\s]+))*\s?[\/\?]?>/g;
33
var nsregex=/<\w*:/, nsregex2 = /<(\/?)\w+:/;
44
function parsexmltag(tag/*:string*/, skip_root/*:?boolean*/)/*:any*/ {
55
var z = ({}/*:any*/);

xlsx.flow.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1664,7 +1664,7 @@ function resolve_path(path/*:string*/, base/*:string*/)/*:string*/ {
16641664
return result.join('/');
16651665
}
16661666
var attregexg=/([^"\s?>\/]+)=((?:")([^"]*)(?:")|(?:')([^']*)(?:')|([^'">\s]+))/g;
1667-
var tagregex=/<[^>]*>/g;
1667+
var tagregex=/<[\/\?]?[a-zA-Z0-9:]+(?:\s+[^"\s?>\/]+=(?:"[^"]*"|'[^']*'|[^'">\s]+))*\s?[\/\?]?>/g;
16681668
var nsregex=/<\w*:/, nsregex2 = /<(\/?)\w+:/;
16691669
function parsexmltag(tag/*:string*/, skip_root/*:?boolean*/)/*:any*/ {
16701670
var z = ({}/*:any*/);

xlsx.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1600,7 +1600,7 @@ function resolve_path(path, base) {
16001600
return result.join('/');
16011601
}
16021602
var attregexg=/([^"\s?>\/]+)=((?:")([^"]*)(?:")|(?:')([^']*)(?:')|([^'">\s]+))/g;
1603-
var tagregex=/<[^>]*>/g;
1603+
var tagregex=/<[\/\?]?[a-zA-Z0-9:]+(?:\s+[^"\s?>\/]+=(?:"[^"]*"|'[^']*'|[^'">\s]+))*\s?[\/\?]?>/g;
16041604
var nsregex=/<\w*:/, nsregex2 = /<(\/?)\w+:/;
16051605
function parsexmltag(tag, skip_root) {
16061606
var z = ({});

0 commit comments

Comments
 (0)