Add WMF to SVG Conversion and Image Inclusion in Markdown Output#87
Open
laura-dietz wants to merge 4 commits intossine:masterfrom
Open
Add WMF to SVG Conversion and Image Inclusion in Markdown Output#87laura-dietz wants to merge 4 commits intossine:masterfrom
laura-dietz wants to merge 4 commits intossine:masterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces two key enhancements to
pptx2md, improving its robustness and extending support for vector graphics.🔧 Summary of Changes
1. WMF Image Support and SVG Conversion
Adds support for extracting
.wmfimages from PowerPoint files.Automatically converts
.wmfto.svgusinginkscapeCLI:References the
.svgin the Markdown output for inclusion in rendered output.2. Bug Fix: Shape Sorting Crash
Fixes a bug in
parser.pywhere ungrouped shapes could lacktoporleftattributes.This previously caused
attrgetter('top', 'left')to crash conversion on some slides.Now uses:
Prevents hard crashes and logs a warning when a malformed shape is encountered.
✅ Behavior Improvements
.wmf-based diagrams, equations, and flowcharts — often used in academic slides.🧱 Dependency Notes
No additional Python dependencies.
Assumes
inkscapeis available in the$PATH..wmfimages are skipped with a warning.🧪 Tested With
Linux (NixOS), Python 3.12
Slide decks containing
.png,.jpeg,.wmf, grouped shapes, and malformed objectsMarkdown output rendered via:
📎 Related