Fix copy-paste and escaping bugs across multiple skill scripts#278
Open
wishhyt wants to merge 4 commits intoopenai:mainfrom
Open
Fix copy-paste and escaping bugs across multiple skill scripts#278wishhyt wants to merge 4 commits intoopenai:mainfrom
wishhyt wants to merge 4 commits intoopenai:mainfrom
Conversation
The regex for parsing PDF page sizes only matched integers (e.g. "612 x 792 pts") but pdfinfo outputs decimal values for A4 and many other paper sizes (e.g. "595.276 x 841.89 pts"). This caused a RuntimeError for any non-US-Letter document going through the PDF-based DPI calculation path. Align the parsing logic with render_slides.py which already handles decimal pts, inches, and bare-number formats correctly. Made-with: Cursor
…xt_to_speech The regex pattern used `\\.` inside a raw string, which the regex engine interprets as a literal backslash followed by any character, instead of matching a decimal point. This prevented parsing fractional retry-after values like "2.5" — only the integer part would be captured. Change `\\.` to `\.` in the raw string so the regex correctly matches a literal period for decimal seconds. Made-with: Cursor
The join delimiter and error message template used "\\n" (literal backslash + n) instead of "\n" (newline character), causing the usage text to render as a single line with visible \n literals instead of proper line breaks. Made-with: Cursor
The fallback conditions for deriving width/height from the SVG viewBox checked the wrong dimension: widthPx assignment guarded on vbh instead of vbw, and heightPx guarded on vbw instead of vbh. When one viewBox dimension is zero (or falsy) but the other is valid, the wrong guard would either incorrectly allow a zero assignment or skip a valid one. Made-with: Cursor
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.
Summary
Code audit found and fixed several small but real bugs across 6 files in 4 different skills. All are copy-paste propagation or escaping errors with unambiguous fixes.
doc/scripts/render_docx.py595.276 x 841.89 pts) and most non-US-Letter sizes would crash withRuntimeError. Aligned parsing with the correct implementation inrender_slides.py.imagegen/scripts/image_gen.py_extract_retry_after_secondsregex used\\.in a raw string, which matches a literal backslash instead of a decimal point. Fractional retry-after values (e.g.2.5) would only capture the integer part.sora/scripts/sora.pyimage_gen.py).speech/scripts/text_to_speech.pyimage_gen.py).chatgpt-apps/scripts/scaffold_node_ext_apps.mjsusage()and error message used"\\n"(literal backslash-n) instead of"\n"(newline), rendering help text as a single unreadable line.slides/assets/pptxgenjs_helpers/image.jswidthPxassignment guarded onvbhinstead ofvbw, and vice versa.What was not changed
Issues found but intentionally not fixed because they are design choices, improvement suggestions, or require more context:
github_utils.py(robustness improvement, not a bug in normal usage)install-skill-from-github.py(complex edge case)fetch_comments.py(needs deeper verification of cursor behavior)detect_font.py(interface design choice)Test plan
render_docx.pycorrectly parses A4 page size (595.276 x 841.89 pts) without crashingretry after: 2.5→2.5)scaffold_node_ext_apps.mjs --helpdisplays multi-line usage text