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 nested code block syntax #128

Merged
merged 1 commit into from
Nov 19, 2021
Merged

Fix nested code block syntax #128

merged 1 commit into from
Nov 19, 2021

Conversation

adamchainz
Copy link
Owner

Fixes #126.

Adjust the RST regex to match all code blocks, and then for non-Python blocks, return the source unaltered. This works since re.sub() only finds non-overlapping matches.

Copy link
Contributor

@asottile asottile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

neat! just a few small things to fix up here

blacken_docs.py Outdated Show resolved Hide resolved
blacken_docs.py Outdated Show resolved Hide resolved
Fixes #126.

Adjust the RST regex to match all code blocks, and then for non-Python blocks, return the source unaltered. This works since `re.sub()` only finds non-overlapping matches.
@adamchainz
Copy link
Owner Author

Fixed both

Copy link
Contributor

@asottile asottile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@asottile asottile merged commit 732d0c0 into adamchainz:master Nov 19, 2021
@adamchainz adamchainz deleted the issue_126_fix_nested_code_blocks branch November 20, 2021 09:58
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.

Nested example failure
2 participants