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

Escape quotes in Repo Description #2

Merged
merged 1 commit into from
May 12, 2024
Merged

Escape quotes in Repo Description #2

merged 1 commit into from
May 12, 2024

Conversation

scubbo
Copy link
Contributor

@scubbo scubbo commented May 12, 2024

Without this logic, quotes in the Description can result in the following invalid pyproject.toml:

[project]
name = "my-project"
version = "0.1"
description = "Air-quotes are really "cool""
readme = "README.md"
...

and invalid cli.py:

...
@click.group()
@click.version_option()
def cli():
    "Air-quotes are really "cool""
...

Verified

This commit was signed with the committer’s verified signature. The key has expired.
@simonw
Copy link
Owner

simonw commented May 12, 2024

Thanks, this is a neat improvement.

@simonw simonw merged commit b7feec3 into simonw:main May 12, 2024
0 of 5 checks passed
@simonw
Copy link
Owner

simonw commented May 12, 2024

Manually tested by creating https://github.com/simonw/test-click-app (now deleted)` - here's the diff it created: https://gist.github.com/simonw/16694db783eb7cc56ca61fa2b3c7a257

In pyproject.toml:

description = "This \"has quotes in it\""

In cli.py:

@click.group()
@click.version_option()
def cli():
    "This \"has quotes in it\""

And in README.md:

This \"has quotes in it\"

But that renders correctly:

CleanShot 2024-05-12 at 10 16 35@2x

simonw added a commit to simonw/python-lib-template-repository that referenced this pull request May 12, 2024
simonw added a commit to simonw/datasette-plugin-template-repository that referenced this pull request May 12, 2024
@simonw
Copy link
Owner

simonw commented May 12, 2024

@scubbo
Copy link
Contributor Author

scubbo commented May 12, 2024

Happy to help :) thanks for all you do, I'm a big fan of your work.

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.

None yet

2 participants