-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
35 lines (35 loc) · 1.05 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="shortcut icon" href="#" />
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
</head>
<body style="background: black;color: white">
<input type="file" id="input" />
<div>
<ul>
<li>文本1</li>
<li><i>文本2</i></li>
</ul>
</div>
<script src="/lib/jszip/jszip.min.js"></script>
<script src="/lib/tinycolor2.min.js"></script>
<script src="/dist/ooxml-parser.umd.js"></script>
<script>
input.addEventListener('change',async (e) => {
const file = e.target.files[0];
const reader = new FileReader();
reader.onload = async(e) => {
const data = e.target.result;
window.ooxmlParser = new OOXMLParser()
window.ooxmlParser.parse(file).then(result => {
console.log(result);
});
};
reader.readAsArrayBuffer(file);
});
</script>
</body>
</html>