Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(pythonFStr): do not expand if whitespace between braces #15

Merged
merged 1 commit into from
Jan 30, 2024

Conversation

Quitlox
Copy link
Contributor

@Quitlox Quitlox commented Jan 30, 2024

Currently the f-string expands if there is whitespace in between the braces, which is likely not when the user intends to use f-strings. The current pattern breaks docstrings containing braces, e.g. a docstring describing an object or json.

It's a slight compromise, as whitespace in braces would not result in an invalid f-string, but this seems to me the more sensible handling.

This would also partially resolve #9.

@chrisgrieser
Copy link
Owner

thx!

just a small tip: in lua, instead of [^%s] you can just do %S

@chrisgrieser chrisgrieser merged commit 90fc0ef into chrisgrieser:main Jan 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Puppeteer gets in the way when using GraphQL or other tools that require curly braced strings
2 participants