feat(slides): support embedded SVG content - #2154
Conversation
📝 WalkthroughWalkthroughThe slide XML schema now supports embedded SVG content through ChangesEmbedded SVG support
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant SlideXML
participant SXSDValidator
participant XMLTextOverlapLint
participant LintTests
SlideXML->>SXSDValidator: Validate embed wildcard children
SXSDValidator-->>XMLTextOverlapLint: Return validation results
XMLTextOverlapLint->>XMLTextOverlapLint: Validate SVG roots and extract embed geometry
XMLTextOverlapLint->>LintTests: Produce visual-content and blank-slide results
LintTests-->>XMLTextOverlapLint: Assert embed diagnostics and analysis
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🚀 PR Preview Install Guide🧰 CLI updatenpm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@f571f90bbefbda9145c70f719d2eb47f5f5c4d75🧩 Skill updatenpx skills add larksuite/cli#feat/slides-embed-svg-protocol -y -g |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2154 +/- ##
==========================================
+ Coverage 75.55% 75.70% +0.14%
==========================================
Files 931 944 +13
Lines 99362 100288 +926
==========================================
+ Hits 75077 75926 +849
- Misses 18549 18565 +16
- Partials 5736 5797 +61 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@skills/lark-slides/scripts/xml_text_overlap_lint.py`:
- Around line 539-567: Update validate_embed_svg_roots to recognize SML embed
elements only when their namespace matches the SML namespace, and use
should_skip_sxsd_subtree during traversal to stop descending into
already-validated embedded SVG payloads. Preserve validation of direct SVG
children under genuine SML embed elements while ignoring unrelated HTML embed
tags inside SVG content.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: e339244f-b040-4490-9e08-80a08b3de1d1
📒 Files selected for processing (5)
skills/lark-slides/references/slides_xml_schema_definition.xmlskills/lark-slides/references/xml-schema-quick-ref.mdskills/lark-slides/scripts/sxsd_validator.pyskills/lark-slides/scripts/xml_text_overlap_lint.pyskills/lark-slides/scripts/xml_text_overlap_lint_test.py
e3e2ab2 to
7b43151
Compare
7b43151 to
06ba13c
Compare
Register <embed> in the bundled Slides SML 2.0 schema, document its SVG contract, and teach the lint/schema validator to handle XSD wildcards and embed geometry. Keep embedded SVG payloads out of IconPark validation so foreign-namespaced <icon> elements inside a payload are not misreported.
06ba13c to
f571f90
Compare
Summary
Add embedded SVG content to the bundled Slides SML 2.0 schema, so a presentation can carry vector graphics inline via a new
<embed>element alongside native shapes and text.Changes
<embed>in the Slides XML schema and document its layout, visual effects, SVG namespace, and child ordering contract.xs:anynamespace, occurrence, and sequence constraints, while requiring embedded SVG content to use an<svg>root.<embed>and include embedded content in element extraction, blank-slide detection, and layout-density checks.<icon>that only shares a local name with the SML element is no longer misreported.<icon>inside an SVG payload.Test Plan
python3 skills/lark-slides/scripts/xml_text_overlap_lint_test.py(188 tests)make unit-testmake script-testgo vet ./...gofmt -l .produces no outputgo mod tidyleavesgo.modandgo.sumunchangedgolangci-lint v2.1.6 run --new-from-rev=origin/mainreports 0 issuesslides_xml_schema_definition.xmlwithxmllintlark-cliAPI verification — not applicable; this change updates the bundled schema and local lint only.Related Issues
Summary by CodeRabbit
New Features
Documentation
Bug Fixes