Fix markdown comments 4843#4852
Conversation
for more information, see https://pre-commit.ci
Please stop opening these PRsIt is evident your contributions have developed with the assistance of LLM/AI tools. This in itself is not problematic, but we still expect you to review and adjust their output in line with the normal quality expectations and requirements. Unfortunately, your contribution does not meet this bar. We do not have the resources to review and correct contributions that are filled with LLM errors and misunderstandings. If you are not already aware:
We understand that you may be using LLMs/AI as an aid for some some disability or barrier. You can use such tools as part of your work, but you are responsible for verifying their output and that they do not negatively impact everyone's ability to engage productively in the contribution process. Thank you for your understanding. |
📝 Pull Request Description
Title
Fix: Preserve
# %% [markdown]comments before# fmt: off(issue #4843)Description of the Bug
black==25.11.0removing%% [markdown]comments #4843# %% [markdown]) caused these comments to be removed unexpectedly.# %% [markdown]line, leaving only:Root Cause
_handle_comment_only_fmt_block()inblack/comments.py.# fmt: offdirectives, failing to preserve them as standalone comment prefixes.The Fix
_handle_comment_only_fmt_block()to:# fmt: off.# %% [markdown]) and similar comments remain intact after formatting.Verification
test_jupytext.py,test_exact_issue.py) to confirm the fix.Environment
Impact
Closing Notes
This PR resolves issue #4843.
Thanks to the community for reporting and verifying the bug. 🎉