Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
wangzishuai5499
js-xlsx
提交
4737d80d
J
js-xlsx
项目概览
wangzishuai5499
/
js-xlsx
与 Fork 源项目一致
从无法访问的项目Fork
通知
8
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
J
js-xlsx
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
4737d80d
编写于
5月 21, 2018
作者:
T
Tom Bousso
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Support namespaced xml in styles.xml
Fixes #1114 h/t @tombousso
上级
d102b75c
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
20 addition
and
20 deletion
+20
-20
bits/47_styxml.js
bits/47_styxml.js
+10
-10
xlsx.flow.js
xlsx.flow.js
+10
-10
xlsx.js
xlsx.js
+0
-0
未找到文件。
bits/47_styxml.js
浏览文件 @
4737d80d
...
...
@@ -5,7 +5,7 @@ function parse_borders(t, styles, themes, opts) {
var
pass
=
false
;
t
[
0
].
match
(
tagregex
).
forEach
(
function
(
x
)
{
var
y
=
parsexmltag
(
x
);
switch
(
y
[
0
]
)
{
switch
(
strip_ns
(
y
[
0
])
)
{
case
'
<borders
'
:
case
'
<borders>
'
:
case
'
</borders>
'
:
break
;
/* 18.8.4 border CT_Border */
...
...
@@ -79,7 +79,7 @@ function parse_fills(t, styles, themes, opts) {
var
pass
=
false
;
t
[
0
].
match
(
tagregex
).
forEach
(
function
(
x
)
{
var
y
=
parsexmltag
(
x
);
switch
(
y
[
0
]
)
{
switch
(
strip_ns
(
y
[
0
])
)
{
case
'
<fills
'
:
case
'
<fills>
'
:
case
'
</fills>
'
:
break
;
/* 18.8.20 fill CT_Fill */
...
...
@@ -145,7 +145,7 @@ function parse_fonts(t, styles, themes, opts) {
var
pass
=
false
;
t
[
0
].
match
(
tagregex
).
forEach
(
function
(
x
)
{
var
y
=
parsexmltag
(
x
);
switch
(
y
[
0
]
)
{
switch
(
strip_ns
(
y
[
0
])
)
{
case
'
<fonts
'
:
case
'
<fonts>
'
:
case
'
</fonts>
'
:
break
;
/* 18.8.22 font CT_Font */
...
...
@@ -263,7 +263,7 @@ function parse_numFmts(t, styles, opts) {
if
(
!
m
)
return
;
for
(
i
=
0
;
i
<
m
.
length
;
++
i
)
{
var
y
=
parsexmltag
(
m
[
i
]);
switch
(
y
[
0
]
)
{
switch
(
strip_ns
(
y
[
0
])
)
{
case
'
<numFmts
'
:
case
'
</numFmts>
'
:
case
'
<numFmts/>
'
:
case
'
<numFmts>
'
:
break
;
case
'
<numFmt
'
:
{
var
f
=
unescapexml
(
utf8read
(
y
.
formatCode
)),
j
=
parseInt
(
y
.
numFmtId
,
10
);
...
...
@@ -302,7 +302,7 @@ function parse_cellXfs(t, styles, opts) {
var
pass
=
false
;
t
[
0
].
match
(
tagregex
).
forEach
(
function
(
x
)
{
var
y
=
parsexmltag
(
x
),
i
=
0
;
switch
(
y
[
0
]
)
{
switch
(
strip_ns
(
y
[
0
])
)
{
case
'
<cellXfs
'
:
case
'
<cellXfs>
'
:
case
'
<cellXfs/>
'
:
case
'
</cellXfs>
'
:
break
;
/* 18.8.45 xf CT_Xf */
...
...
@@ -357,11 +357,11 @@ function write_cellXfs(cellXfs)/*:string*/ {
/* 18.8 Styles CT_Stylesheet*/
var
parse_sty_xml
=
(
function
make_pstyx
()
{
var
numFmtRegex
=
/<
numFmts
([^
>
]
*
)
>
[\S\s]
*
?
<
\/
numFmts>/
;
var
cellXfRegex
=
/<
cellXfs
([^
>
]
*
)
>
[\S\s]
*
?
<
\/
cellXfs>/
;
var
fillsRegex
=
/<
fills
([^
>
]
*
)
>
[\S\s]
*
?
<
\/
fills>/
;
var
fontsRegex
=
/<
fonts
([^
>
]
*
)
>
[\S\s]
*
?
<
\/
fonts>/
;
var
bordersRegex
=
/<
borders
([^
>
]
*
)
>
[\S\s]
*
?
<
\/
borders>/
;
var
numFmtRegex
=
/<
(?:\w
+:
)?
numFmts
([^
>
]
*
)
>
[\S\s]
*
?
<
\/(?:\w
+:
)?
numFmts>/
;
var
cellXfRegex
=
/<
(?:\w
+:
)?
cellXfs
([^
>
]
*
)
>
[\S\s]
*
?
<
\/(?:\w
+:
)?
cellXfs>/
;
var
fillsRegex
=
/<
(?:\w
+:
)?
fills
([^
>
]
*
)
>
[\S\s]
*
?
<
\/(?:\w
+:
)?
fills>/
;
var
fontsRegex
=
/<
(?:\w
+:
)?
fonts
([^
>
]
*
)
>
[\S\s]
*
?
<
\/(?:\w
+:
)?
fonts>/
;
var
bordersRegex
=
/<
(?:\w
+:
)?
borders
([^
>
]
*
)
>
[\S\s]
*
?
<
\/(?:\w
+:
)?
borders>/
;
return
function
parse_sty_xml
(
data
,
themes
,
opts
)
{
var
styles
=
{};
...
...
xlsx.flow.js
浏览文件 @
4737d80d
...
...
@@ -7953,7 +7953,7 @@ function parse_borders(t, styles, themes, opts) {
var pass = false;
t[0].match(tagregex).forEach(function(x) {
var y = parsexmltag(x);
switch
(y[0]
) {
switch
(strip_ns(y[0])
) {
case '<borders': case '<borders>': case '</borders>': break;
/* 18.8.4 border CT_Border */
...
...
@@ -8027,7 +8027,7 @@ function parse_fills(t, styles, themes, opts) {
var pass = false;
t[0].match(tagregex).forEach(function(x) {
var y = parsexmltag(x);
switch(
y[0]
) {
switch(
strip_ns(y[0])
) {
case '<fills': case '<fills>': case '</fills>': break;
/* 18.8.20 fill CT_Fill */
...
...
@@ -8093,7 +8093,7 @@ function parse_fonts(t, styles, themes, opts) {
var pass = false;
t[0].match(tagregex).forEach(function(x) {
var y = parsexmltag(x);
switch
(y[0]
) {
switch
(strip_ns(y[0])
) {
case '<fonts': case '<fonts>': case '</fonts>': break;
/* 18.8.22 font CT_Font */
...
...
@@ -8211,7 +8211,7 @@ function parse_numFmts(t, styles, opts) {
if(!m) return;
for(i=0; i < m.length; ++i) {
var y = parsexmltag(m[i]);
switch(
y[0]
) {
switch(
strip_ns(y[0])
) {
case '<numFmts': case '</numFmts>': case '<numFmts/>': case '<numFmts>': break;
case '<numFmt': {
var f=unescapexml(utf8read(y.formatCode)), j=parseInt(y.numFmtId,10);
...
...
@@ -8250,7 +8250,7 @@ function parse_cellXfs(t, styles, opts) {
var pass = false;
t[0].match(tagregex).forEach(function(x) {
var y = parsexmltag(x), i = 0;
switch(
y[0]
) {
switch(
strip_ns(y[0])
) {
case '<cellXfs': case '<cellXfs>': case '<cellXfs/>': case '</cellXfs>': break;
/* 18.8.45 xf CT_Xf */
...
...
@@ -8305,11 +8305,11 @@ function write_cellXfs(cellXfs)/*:string*/ {
/* 18.8 Styles CT_Stylesheet*/
var parse_sty_xml= (function make_pstyx() {
var numFmtRegex = /<
numFmts([^>]*)>[\S\s]*?<\/
numFmts>/;
var cellXfRegex = /<
cellXfs([^>]*)>[\S\s]*?<\/
cellXfs>/;
var fillsRegex = /<
fills([^>]*)>[\S\s]*?<\/
fills>/;
var fontsRegex = /<
fonts([^>]*)>[\S\s]*?<\/
fonts>/;
var bordersRegex = /<
borders([^>]*)>[\S\s]*?<\/
borders>/;
var numFmtRegex = /<
(?:\w+:)?numFmts([^>]*)>[\S\s]*?<\/(?:\w+:)?
numFmts>/;
var cellXfRegex = /<
(?:\w+:)?cellXfs([^>]*)>[\S\s]*?<\/(?:\w+:)?
cellXfs>/;
var fillsRegex = /<
(?:\w+:)?fills([^>]*)>[\S\s]*?<\/(?:\w+:)?
fills>/;
var fontsRegex = /<
(?:\w+:)?fonts([^>]*)>[\S\s]*?<\/(?:\w+:)?
fonts>/;
var bordersRegex = /<
(?:\w+:)?borders([^>]*)>[\S\s]*?<\/(?:\w+:)?
borders>/;
return function parse_sty_xml(data, themes, opts) {
var styles = {};
...
...
xlsx.js
浏览文件 @
4737d80d
此差异由.gitattributes 抑制。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录