fix: respect single-quoted strings when splitting FFmpeg filtergraph (#593)#938
Open
lucemia wants to merge 2 commits into
Open
fix: respect single-quoted strings when splitting FFmpeg filtergraph (#593)#938lucemia wants to merge 2 commits into
lucemia wants to merge 2 commits into
Conversation
Commas and other separators inside single-quoted filter option values (e.g. force_style='Fontname=Arial,Fontsize=17') were incorrectly treated as filterchain separators, breaking parse of commands like the one reported in issue #593. Rewrote `splitUnescaped` (TypeScript) and `_split_unescaped` (Python) to iterate character-by-character, skipping separators that appear inside single-quoted sections. Backslash escaping outside quotes is preserved. Both implementations now behave identically; tests added for both to verify the fix. Fixes #593 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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
splitUnescaped(TypeScript) and_split_unescaped(Python) used a simple regex/lookbehind that only handled backslash-escaped separators. FFmpeg filter option syntax also allows single-quoted strings (e.g.force_style='Fontname=Arial,Fontsize=17') where commas and other separator characters must be treated as literal content, not split points.compile_cli.py.jinja) + all four generated packages (v5–v8) + TypeScript core. Both implementations are now identical in behaviour.Test plan
-vffilterchain with single-quotedforce_stylevalue containing commas — verifiesscale,pad,subtitlesall appear in compiled outputtest_vf_single_quoted_params_with_commas138/138139/139(6 skipped)Fixes #593
🤖 Generated with Claude Code