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

Check for underscores used instead of stars for emphasis #98

Open
jeanas opened this issue Nov 4, 2023 · 1 comment
Open

Check for underscores used instead of stars for emphasis #98

jeanas opened this issue Nov 4, 2023 · 1 comment

Comments

@jeanas
Copy link
Contributor

jeanas commented Nov 4, 2023

While Markdown allows both _emphasis_ and *emphasis*, reST only has *emphasis*. On this page of the packaging user guide, someone apparently thought underscores would work: https://packaging.python.org/en/latest/specifications/name-normalization/

FrIeNdLy-._.-bArD (a _terrible_ way to write a name, but it is valid)

@ezio-melotti
Copy link
Collaborator

This might get tricky, since there are several cases that are ambiguous, especially when the emphasis includes multiple words. I guess we could detect and mark something like \b_[^_]+_\b as errors (even though there might show up in expressions like ``res = _var_ + 1``) and ignore emphasis spanning multiple words.

Another option is to make the checker more comprehensive, but make it optional, since the risk of false positive becomes higher.

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

No branches or pull requests

2 participants