opencode-skills-collection 3.1.6 → 3.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundled-skills/.antigravity-install-manifest.json +9 -1
- package/bundled-skills/007/scripts/scanners/dependency_scanner.py +2 -2
- package/bundled-skills/arrowspace/SKILL.md +116 -0
- package/bundled-skills/docs/contributors/quality-bar.md +1 -0
- package/bundled-skills/docs/contributors/skill-anatomy.md +19 -3
- package/bundled-skills/docs/integrations/jetski-cortex.md +3 -3
- package/bundled-skills/docs/integrations/jetski-gemini-loader/README.md +1 -1
- package/bundled-skills/docs/maintainers/categorization-implementation.md +14 -24
- package/bundled-skills/docs/maintainers/repo-growth-seo.md +3 -3
- package/bundled-skills/docs/maintainers/skills-update-guide.md +1 -1
- package/bundled-skills/docs/maintainers/smart-auto-categorization.md +24 -25
- package/bundled-skills/docs/users/bundles.md +1 -1
- package/bundled-skills/docs/users/claude-code-skills.md +1 -1
- package/bundled-skills/docs/users/faq.md +5 -5
- package/bundled-skills/docs/users/gemini-cli-skills.md +1 -1
- package/bundled-skills/docs/users/getting-started.md +1 -1
- package/bundled-skills/docs/users/kiro-integration.md +1 -1
- package/bundled-skills/docs/users/local-config.md +11 -11
- package/bundled-skills/docs/users/specialized-plugin-roadmap.md +3 -3
- package/bundled-skills/docs/users/usage.md +4 -4
- package/bundled-skills/docs/users/visual-guide.md +4 -4
- package/bundled-skills/docs/vietnamese/BUNDLES.vi.md +1 -1
- package/bundled-skills/docs/vietnamese/CONTRIBUTING.vi.md +15 -9
- package/bundled-skills/docs/vietnamese/FAQ.vi.md +30 -20
- package/bundled-skills/docs/vietnamese/GETTING_STARTED.vi.md +22 -14
- package/bundled-skills/docs/vietnamese/QUALITY_BAR.vi.md +9 -4
- package/bundled-skills/docs/vietnamese/README.vi.md +29 -30
- package/bundled-skills/docs/vietnamese/SKILLS_README.vi.md +3 -3
- package/bundled-skills/docs/vietnamese/SKILL_ANATOMY.vi.md +33 -5
- package/bundled-skills/docs/vietnamese/TRANSLATION_PLAN.vi.md +1 -1
- package/bundled-skills/docs/vietnamese/VISUAL_GUIDE.vi.md +17 -18
- package/bundled-skills/docx-official/ooxml/scripts/pack.py +12 -0
- package/bundled-skills/docx-official/ooxml/scripts/unpack.py +28 -7
- package/bundled-skills/docx-official/ooxml/scripts/validation/base.py +18 -13
- package/bundled-skills/docx-official/ooxml/scripts/validation/docx.py +6 -6
- package/bundled-skills/docx-official/ooxml/scripts/validation/pptx.py +6 -6
- package/bundled-skills/emil-design-eng/SKILL.md +702 -0
- package/bundled-skills/gh-image/SKILL.md +122 -0
- package/bundled-skills/github-actions-debugger/SKILL.md +99 -0
- package/bundled-skills/hugging-face-model-trainer/scripts/convert_to_gguf.py +3 -2
- package/bundled-skills/infinity/SKILL.md +173 -0
- package/bundled-skills/loki-mode/autonomy/run.sh +17 -8
- package/bundled-skills/loki-mode/examples/todo-app-generated/backend/package-lock.json +17 -13
- package/bundled-skills/loki-mode/examples/todo-app-generated/backend/package.json +3 -3
- package/bundled-skills/loki-mode/examples/todo-app-generated/frontend/package-lock.json +9 -9
- package/bundled-skills/loki-mode/examples/todo-app-generated/frontend/package.json +2 -2
- package/bundled-skills/macos-spm-app-packaging/assets/templates/setup_dev_signing.sh +11 -8
- package/bundled-skills/macos-spm-app-packaging/assets/templates/sign-and-notarize.sh +10 -5
- package/bundled-skills/pptx-official/ooxml/scripts/pack.py +12 -0
- package/bundled-skills/pptx-official/ooxml/scripts/unpack.py +28 -7
- package/bundled-skills/pptx-official/ooxml/scripts/validation/base.py +18 -13
- package/bundled-skills/pptx-official/ooxml/scripts/validation/docx.py +6 -6
- package/bundled-skills/pptx-official/ooxml/scripts/validation/pptx.py +6 -6
- package/bundled-skills/premium-3d-website/SKILL.md +133 -0
- package/bundled-skills/review-animations/SKILL.md +139 -0
- package/bundled-skills/review-animations/STANDARDS.md +188 -0
- package/bundled-skills/skill-creator/scripts/package_skill.py +11 -1
- package/package.json +1 -1
- package/skills_index.json +132 -0
|
@@ -33,7 +33,7 @@ antigravity-awesome-skills/
|
|
|
33
33
|
├── 📄 README.md ← Tổng quan & danh sách skill
|
|
34
34
|
├── 📄 CONTRIBUTING.md ← Cách thức đóng góp
|
|
35
35
|
│
|
|
36
|
-
├── 📁 skills/ ←
|
|
36
|
+
├── 📁 skills/ ← Nguồn canonical cho 1,684+ skills
|
|
37
37
|
│ │
|
|
38
38
|
│ ├── 📁 brainstorming/
|
|
39
39
|
│ │ └── 📄 SKILL.md ← Định nghĩa skill
|
|
@@ -42,11 +42,12 @@ antigravity-awesome-skills/
|
|
|
42
42
|
│ │ ├── 📄 SKILL.md
|
|
43
43
|
│ │ └── 📁 examples/ ← Các phần bổ sung tùy chọn
|
|
44
44
|
│ │
|
|
45
|
-
│ └── ... (
|
|
45
|
+
│ └── ... (1,684+ skills khác)
|
|
46
46
|
│
|
|
47
|
-
├── 📁
|
|
48
|
-
│ ├──
|
|
49
|
-
│
|
|
47
|
+
├── 📁 tools/
|
|
48
|
+
│ ├── 📁 scripts/ ← Quản lý, xác thực và tạo catalog
|
|
49
|
+
│ ├── 📁 lib/ ← Logic installer dùng chung
|
|
50
|
+
│ └── 📁 bin/ ← CLI entrypoint
|
|
50
51
|
│
|
|
51
52
|
├── 📁 .github/
|
|
52
53
|
│ └── 📄 MAINTENANCE.md ← Hướng dẫn cho người duy trì
|
|
@@ -66,7 +67,7 @@ antigravity-awesome-skills/
|
|
|
66
67
|
|
|
67
68
|
```
|
|
68
69
|
┌──────────────┐
|
|
69
|
-
│ 1. CÀI ĐẶT │
|
|
70
|
+
│ 1. CÀI ĐẶT │ npx antigravity-awesome-skills
|
|
70
71
|
1 └──────┬───────┘
|
|
71
72
|
│
|
|
72
73
|
↓
|
|
@@ -96,7 +97,7 @@ antigravity-awesome-skills/
|
|
|
96
97
|
|
|
97
98
|
```
|
|
98
99
|
┌─────────────────────────┐
|
|
99
|
-
│
|
|
100
|
+
│ 1,684+ AWESOME SKILLS │
|
|
100
101
|
└────────────┬────────────┘
|
|
101
102
|
│
|
|
102
103
|
┌────────────────────────┼────────────────────────┐
|
|
@@ -174,17 +175,15 @@ antigravity-awesome-skills/
|
|
|
174
175
|
|
|
175
176
|
## Cài đặt (Các bước Trực quan)
|
|
176
177
|
|
|
177
|
-
### Bước 1:
|
|
178
|
+
### Bước 1: Cài đặt bằng installer
|
|
178
179
|
|
|
179
180
|
```
|
|
180
181
|
┌─────────────────────────────────────────┐
|
|
181
182
|
│ Terminal │
|
|
182
183
|
├─────────────────────────────────────────┤
|
|
183
|
-
│ $
|
|
184
|
-
│ sickn33/antigravity-awesome-skills │
|
|
185
|
-
│ .agent/skills │
|
|
184
|
+
│ $ npx antigravity-awesome-skills │
|
|
186
185
|
│ │
|
|
187
|
-
│ ✓
|
|
186
|
+
│ ✓ Cài vào '~/.agents/skills'... │
|
|
188
187
|
│ ✓ Hoàn tất! │
|
|
189
188
|
└─────────────────────────────────────────┘
|
|
190
189
|
```
|
|
@@ -195,12 +194,12 @@ antigravity-awesome-skills/
|
|
|
195
194
|
┌─────────────────────────────────────────┐
|
|
196
195
|
│ File Explorer │
|
|
197
196
|
├─────────────────────────────────────────┤
|
|
198
|
-
│ 📁
|
|
197
|
+
│ 📁 ~/.agents/ │
|
|
199
198
|
│ └── 📁 skills/ │
|
|
200
199
|
│ ├── 📁 brainstorming/ │
|
|
201
200
|
│ ├── 📁 stripe-integration/ │
|
|
202
201
|
│ ├── 📁 react-best-practices/ │
|
|
203
|
-
│ └── ... (
|
|
202
|
+
│ └── ... (1,684+ skills) │
|
|
204
203
|
└─────────────────────────────────────────┘
|
|
205
204
|
```
|
|
206
205
|
|
|
@@ -313,12 +312,12 @@ Mở file skills_index.json → Tìm từ khóa → Tìm đường dẫn đến
|
|
|
313
312
|
│
|
|
314
313
|
↓
|
|
315
314
|
┌──────────────┐
|
|
316
|
-
│ 4. KIỂM THỬ │
|
|
315
|
+
│ 4. KIỂM THỬ │ Cài bằng npx hoặc --path thử nghiệm
|
|
317
316
|
└──────┬───────┘ Thử: @docker-mastery
|
|
318
317
|
│
|
|
319
318
|
↓
|
|
320
319
|
┌──────────────┐
|
|
321
|
-
│ 5. XÁC THỰC │
|
|
320
|
+
│ 5. XÁC THỰC │ npm run validate
|
|
322
321
|
└──────┬───────┘
|
|
323
322
|
│
|
|
324
323
|
↓
|
|
@@ -437,7 +436,7 @@ BẮT ĐẦU TẠI ĐÂY
|
|
|
437
436
|
├─────────────────────────────────────────────────────────────┤
|
|
438
437
|
│ │
|
|
439
438
|
│ 📥 CÀI ĐẶT │
|
|
440
|
-
│
|
|
439
|
+
│ npx antigravity-awesome-skills │
|
|
441
440
|
│ │
|
|
442
441
|
│ 🎯 SỬ DỤNG │
|
|
443
442
|
│ @ten-skill [yêu cầu của bạn] │
|
|
@@ -446,7 +445,7 @@ BẮT ĐẦU TẠI ĐÂY
|
|
|
446
445
|
│ ls skills/ | grep "từ-khóa" │
|
|
447
446
|
│ │
|
|
448
447
|
│ ✅ XÁC THỰC │
|
|
449
|
-
│
|
|
448
|
+
│ npm run validate │
|
|
450
449
|
│ │
|
|
451
450
|
│ 📝 TẠO SKILL │
|
|
452
451
|
│ 1. mkdir skills/ten-skill-cua-ban │
|
|
@@ -16,6 +16,17 @@ import zipfile
|
|
|
16
16
|
from pathlib import Path
|
|
17
17
|
|
|
18
18
|
|
|
19
|
+
def validate_input_tree(input_dir: Path):
|
|
20
|
+
root = input_dir.resolve(strict=True)
|
|
21
|
+
for path in input_dir.rglob("*"):
|
|
22
|
+
if path.is_symlink():
|
|
23
|
+
raise ValueError(f"Refusing to pack symlink: {path}")
|
|
24
|
+
try:
|
|
25
|
+
path.resolve(strict=True).relative_to(root)
|
|
26
|
+
except (OSError, ValueError):
|
|
27
|
+
raise ValueError(f"Refusing to pack path outside input directory: {path}") from None
|
|
28
|
+
|
|
29
|
+
|
|
19
30
|
def main():
|
|
20
31
|
parser = argparse.ArgumentParser(description="Pack a directory into an Office file")
|
|
21
32
|
parser.add_argument("input_directory", help="Unpacked Office document directory")
|
|
@@ -60,6 +71,7 @@ def pack_document(input_dir, output_file, validate=False):
|
|
|
60
71
|
raise ValueError(f"{input_dir} is not a directory")
|
|
61
72
|
if output_file.suffix.lower() not in {".docx", ".pptx", ".xlsx"}:
|
|
62
73
|
raise ValueError(f"{output_file} must be a .docx, .pptx, or .xlsx file")
|
|
74
|
+
validate_input_tree(input_dir)
|
|
63
75
|
|
|
64
76
|
# Work in temporary directory to avoid modifying original
|
|
65
77
|
with tempfile.TemporaryDirectory() as temp_dir:
|
|
@@ -8,6 +8,11 @@ import sys
|
|
|
8
8
|
import zipfile
|
|
9
9
|
from pathlib import Path
|
|
10
10
|
|
|
11
|
+
MAX_ARCHIVE_MEMBERS = 5000
|
|
12
|
+
MAX_MEMBER_SIZE = 100 * 1024 * 1024
|
|
13
|
+
MAX_TOTAL_UNCOMPRESSED = 512 * 1024 * 1024
|
|
14
|
+
MAX_COMPRESSION_RATIO = 1000
|
|
15
|
+
|
|
11
16
|
|
|
12
17
|
def _is_zip_symlink(member: zipfile.ZipInfo) -> bool:
|
|
13
18
|
return stat.S_ISLNK(member.external_attr >> 16)
|
|
@@ -29,19 +34,35 @@ def _extract_member(archive: zipfile.ZipFile, member: zipfile.ZipInfo, output_ro
|
|
|
29
34
|
shutil.copyfileobj(source, target)
|
|
30
35
|
|
|
31
36
|
|
|
37
|
+
def _validate_archive_members(archive: zipfile.ZipFile, output_root: Path):
|
|
38
|
+
members = archive.infolist()
|
|
39
|
+
if len(members) > MAX_ARCHIVE_MEMBERS:
|
|
40
|
+
raise ValueError("Archive contains too many entries")
|
|
41
|
+
|
|
42
|
+
total_size = 0
|
|
43
|
+
for member in members:
|
|
44
|
+
if _is_zip_symlink(member):
|
|
45
|
+
raise ValueError(f"Unsafe archive entry: {member.filename}")
|
|
46
|
+
if not _is_safe_destination(output_root, member.filename):
|
|
47
|
+
raise ValueError(f"Unsafe archive entry: {member.filename}")
|
|
48
|
+
if member.file_size > MAX_MEMBER_SIZE:
|
|
49
|
+
raise ValueError(f"Archive entry too large: {member.filename}")
|
|
50
|
+
total_size += member.file_size
|
|
51
|
+
if total_size > MAX_TOTAL_UNCOMPRESSED:
|
|
52
|
+
raise ValueError("Archive uncompressed size is too large")
|
|
53
|
+
if member.compress_size and member.file_size / member.compress_size > MAX_COMPRESSION_RATIO:
|
|
54
|
+
raise ValueError(f"Archive entry compression ratio too high: {member.filename}")
|
|
55
|
+
|
|
56
|
+
return members
|
|
57
|
+
|
|
58
|
+
|
|
32
59
|
def extract_archive_safely(input_file: str | Path, output_dir: str | Path):
|
|
33
60
|
output_path = Path(output_dir)
|
|
34
61
|
output_path.mkdir(parents=True, exist_ok=True)
|
|
35
62
|
output_root = output_path.resolve()
|
|
36
63
|
|
|
37
64
|
with zipfile.ZipFile(input_file) as archive:
|
|
38
|
-
for member in archive
|
|
39
|
-
if _is_zip_symlink(member):
|
|
40
|
-
raise ValueError(f"Unsafe archive entry: {member.filename}")
|
|
41
|
-
if not _is_safe_destination(output_root, member.filename):
|
|
42
|
-
raise ValueError(f"Unsafe archive entry: {member.filename}")
|
|
43
|
-
|
|
44
|
-
for member in archive.infolist():
|
|
65
|
+
for member in _validate_archive_members(archive, output_root):
|
|
45
66
|
_extract_member(archive, member, output_path)
|
|
46
67
|
|
|
47
68
|
|
|
@@ -9,6 +9,14 @@ from pathlib import Path
|
|
|
9
9
|
import lxml.etree
|
|
10
10
|
|
|
11
11
|
|
|
12
|
+
def hardened_xml_parser():
|
|
13
|
+
return lxml.etree.XMLParser(resolve_entities=False, no_network=True, load_dtd=False, huge_tree=False)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def parse_xml(source, **kwargs):
|
|
17
|
+
return lxml.etree.parse(source, parser=hardened_xml_parser(), **kwargs)
|
|
18
|
+
|
|
19
|
+
|
|
12
20
|
def safe_extract_all(zip_ref, destination):
|
|
13
21
|
"""Extract a zip archive without allowing members to escape destination."""
|
|
14
22
|
destination = Path(destination).resolve()
|
|
@@ -149,7 +157,7 @@ class BaseSchemaValidator:
|
|
|
149
157
|
for xml_file in self.xml_files:
|
|
150
158
|
try:
|
|
151
159
|
# Try to parse the XML file
|
|
152
|
-
|
|
160
|
+
parse_xml(str(xml_file))
|
|
153
161
|
except lxml.etree.XMLSyntaxError as e:
|
|
154
162
|
errors.append(
|
|
155
163
|
f" {xml_file.relative_to(self.unpacked_dir)}: "
|
|
@@ -177,7 +185,7 @@ class BaseSchemaValidator:
|
|
|
177
185
|
|
|
178
186
|
for xml_file in self.xml_files:
|
|
179
187
|
try:
|
|
180
|
-
root =
|
|
188
|
+
root = parse_xml(str(xml_file)).getroot()
|
|
181
189
|
declared = set(root.nsmap.keys()) - {None} # Exclude default namespace
|
|
182
190
|
|
|
183
191
|
for attr_val in [
|
|
@@ -208,7 +216,7 @@ class BaseSchemaValidator:
|
|
|
208
216
|
|
|
209
217
|
for xml_file in self.xml_files:
|
|
210
218
|
try:
|
|
211
|
-
root =
|
|
219
|
+
root = parse_xml(str(xml_file)).getroot()
|
|
212
220
|
file_ids = {} # Track IDs that must be unique within this file
|
|
213
221
|
|
|
214
222
|
# Remove all mc:AlternateContent elements from the tree
|
|
@@ -328,7 +336,7 @@ class BaseSchemaValidator:
|
|
|
328
336
|
for rels_file in rels_files:
|
|
329
337
|
try:
|
|
330
338
|
# Parse relationships file
|
|
331
|
-
rels_root =
|
|
339
|
+
rels_root = parse_xml(str(rels_file)).getroot()
|
|
332
340
|
|
|
333
341
|
# Get the directory where this .rels file is located
|
|
334
342
|
rels_dir = rels_file.parent
|
|
@@ -429,7 +437,7 @@ class BaseSchemaValidator:
|
|
|
429
437
|
|
|
430
438
|
try:
|
|
431
439
|
# Parse the .rels file to get valid relationship IDs and their types
|
|
432
|
-
rels_root =
|
|
440
|
+
rels_root = parse_xml(str(rels_file)).getroot()
|
|
433
441
|
rid_to_type = {}
|
|
434
442
|
|
|
435
443
|
for rel in rels_root.findall(
|
|
@@ -452,7 +460,7 @@ class BaseSchemaValidator:
|
|
|
452
460
|
rid_to_type[rid] = type_name
|
|
453
461
|
|
|
454
462
|
# Parse the XML file to find all r:id references
|
|
455
|
-
xml_root =
|
|
463
|
+
xml_root = parse_xml(str(xml_file)).getroot()
|
|
456
464
|
|
|
457
465
|
# Find all elements with r:id attributes
|
|
458
466
|
for elem in xml_root.iter():
|
|
@@ -549,7 +557,7 @@ class BaseSchemaValidator:
|
|
|
549
557
|
|
|
550
558
|
try:
|
|
551
559
|
# Parse and get all declared parts and extensions
|
|
552
|
-
root =
|
|
560
|
+
root = parse_xml(str(content_types_file)).getroot()
|
|
553
561
|
declared_parts = set()
|
|
554
562
|
declared_extensions = set()
|
|
555
563
|
|
|
@@ -611,7 +619,7 @@ class BaseSchemaValidator:
|
|
|
611
619
|
continue
|
|
612
620
|
|
|
613
621
|
try:
|
|
614
|
-
root_tag =
|
|
622
|
+
root_tag = parse_xml(str(xml_file)).getroot().tag
|
|
615
623
|
root_name = root_tag.split("}")[-1] if "}" in root_tag else root_tag
|
|
616
624
|
|
|
617
625
|
if root_name in declarable_roots and path_str not in declared_parts:
|
|
@@ -850,15 +858,12 @@ class BaseSchemaValidator:
|
|
|
850
858
|
try:
|
|
851
859
|
# Load schema
|
|
852
860
|
with open(schema_path, "rb") as xsd_file:
|
|
853
|
-
|
|
854
|
-
xsd_doc = lxml.etree.parse(
|
|
855
|
-
xsd_file, parser=parser, base_url=str(schema_path)
|
|
856
|
-
)
|
|
861
|
+
xsd_doc = parse_xml(xsd_file, base_url=str(schema_path))
|
|
857
862
|
schema = lxml.etree.XMLSchema(xsd_doc)
|
|
858
863
|
|
|
859
864
|
# Load and preprocess XML
|
|
860
865
|
with open(xml_file, "r") as f:
|
|
861
|
-
xml_doc =
|
|
866
|
+
xml_doc = parse_xml(f)
|
|
862
867
|
|
|
863
868
|
xml_doc, _ = self._remove_template_tags_from_text_nodes(xml_doc)
|
|
864
869
|
xml_doc = self._preprocess_for_mc_ignorable(xml_doc)
|
|
@@ -10,7 +10,7 @@ from pathlib import Path
|
|
|
10
10
|
|
|
11
11
|
import lxml.etree
|
|
12
12
|
|
|
13
|
-
from .base import BaseSchemaValidator
|
|
13
|
+
from .base import BaseSchemaValidator, parse_xml
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
def safe_extract_all(zip_ref, destination):
|
|
@@ -100,7 +100,7 @@ class DOCXSchemaValidator(BaseSchemaValidator):
|
|
|
100
100
|
continue
|
|
101
101
|
|
|
102
102
|
try:
|
|
103
|
-
root =
|
|
103
|
+
root = parse_xml(str(xml_file)).getroot()
|
|
104
104
|
|
|
105
105
|
# Find all w:t elements
|
|
106
106
|
for elem in root.iter(f"{{{self.WORD_2006_NAMESPACE}}}t"):
|
|
@@ -153,7 +153,7 @@ class DOCXSchemaValidator(BaseSchemaValidator):
|
|
|
153
153
|
continue
|
|
154
154
|
|
|
155
155
|
try:
|
|
156
|
-
root =
|
|
156
|
+
root = parse_xml(str(xml_file)).getroot()
|
|
157
157
|
|
|
158
158
|
# Find all w:t elements that are descendants of w:del elements
|
|
159
159
|
namespaces = {"w": self.WORD_2006_NAMESPACE}
|
|
@@ -199,7 +199,7 @@ class DOCXSchemaValidator(BaseSchemaValidator):
|
|
|
199
199
|
continue
|
|
200
200
|
|
|
201
201
|
try:
|
|
202
|
-
root =
|
|
202
|
+
root = parse_xml(str(xml_file)).getroot()
|
|
203
203
|
# Count all w:p elements
|
|
204
204
|
paragraphs = root.findall(f".//{{{self.WORD_2006_NAMESPACE}}}p")
|
|
205
205
|
count = len(paragraphs)
|
|
@@ -221,7 +221,7 @@ class DOCXSchemaValidator(BaseSchemaValidator):
|
|
|
221
221
|
|
|
222
222
|
# Parse document.xml
|
|
223
223
|
doc_xml_path = temp_dir + "/word/document.xml"
|
|
224
|
-
root =
|
|
224
|
+
root = parse_xml(doc_xml_path).getroot()
|
|
225
225
|
|
|
226
226
|
# Count all w:p elements
|
|
227
227
|
paragraphs = root.findall(f".//{{{self.WORD_2006_NAMESPACE}}}p")
|
|
@@ -244,7 +244,7 @@ class DOCXSchemaValidator(BaseSchemaValidator):
|
|
|
244
244
|
continue
|
|
245
245
|
|
|
246
246
|
try:
|
|
247
|
-
root =
|
|
247
|
+
root = parse_xml(str(xml_file)).getroot()
|
|
248
248
|
namespaces = {"w": self.WORD_2006_NAMESPACE}
|
|
249
249
|
|
|
250
250
|
# Find w:delText in w:ins that are NOT within w:del
|
|
@@ -4,7 +4,7 @@ Validator for PowerPoint presentation XML files against XSD schemas.
|
|
|
4
4
|
|
|
5
5
|
import re
|
|
6
6
|
|
|
7
|
-
from .base import BaseSchemaValidator
|
|
7
|
+
from .base import BaseSchemaValidator, parse_xml
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
class PPTXSchemaValidator(BaseSchemaValidator):
|
|
@@ -86,7 +86,7 @@ class PPTXSchemaValidator(BaseSchemaValidator):
|
|
|
86
86
|
|
|
87
87
|
for xml_file in self.xml_files:
|
|
88
88
|
try:
|
|
89
|
-
root =
|
|
89
|
+
root = parse_xml(str(xml_file)).getroot()
|
|
90
90
|
|
|
91
91
|
# Check all elements for ID attributes
|
|
92
92
|
for elem in root.iter():
|
|
@@ -142,7 +142,7 @@ class PPTXSchemaValidator(BaseSchemaValidator):
|
|
|
142
142
|
for slide_master in slide_masters:
|
|
143
143
|
try:
|
|
144
144
|
# Parse the slide master file
|
|
145
|
-
root =
|
|
145
|
+
root = parse_xml(str(slide_master)).getroot()
|
|
146
146
|
|
|
147
147
|
# Find the corresponding _rels file for this slide master
|
|
148
148
|
rels_file = slide_master.parent / "_rels" / f"{slide_master.name}.rels"
|
|
@@ -155,7 +155,7 @@ class PPTXSchemaValidator(BaseSchemaValidator):
|
|
|
155
155
|
continue
|
|
156
156
|
|
|
157
157
|
# Parse the relationships file
|
|
158
|
-
rels_root =
|
|
158
|
+
rels_root = parse_xml(str(rels_file)).getroot()
|
|
159
159
|
|
|
160
160
|
# Build a set of valid relationship IDs that point to slide layouts
|
|
161
161
|
valid_layout_rids = set()
|
|
@@ -209,7 +209,7 @@ class PPTXSchemaValidator(BaseSchemaValidator):
|
|
|
209
209
|
|
|
210
210
|
for rels_file in slide_rels_files:
|
|
211
211
|
try:
|
|
212
|
-
root =
|
|
212
|
+
root = parse_xml(str(rels_file)).getroot()
|
|
213
213
|
|
|
214
214
|
# Find all slideLayout relationships
|
|
215
215
|
layout_rels = [
|
|
@@ -258,7 +258,7 @@ class PPTXSchemaValidator(BaseSchemaValidator):
|
|
|
258
258
|
for rels_file in slide_rels_files:
|
|
259
259
|
try:
|
|
260
260
|
# Parse the relationships file
|
|
261
|
-
root =
|
|
261
|
+
root = parse_xml(str(rels_file)).getroot()
|
|
262
262
|
|
|
263
263
|
# Find all notesSlide relationships
|
|
264
264
|
for rel in root.findall(
|