Fix link to Sphinx code block directives (#23041)
Summary
--
I noticed this while reviewing #22990. I'm not really sure why the
current version doesn't work, but the new one definitely does.
Test Plan
--
[Before](https://docs.astral.sh/ruff/formatter/#docstring-formatting):
<img width="457" height="77" alt="image"
src="https://github.com/user-attachments/assets/3d4394b7-eadf-41ec-81c9-cea6190fa0bb"
/>
After:
<img width="493" height="84" alt="image"
src="https://github.com/user-attachments/assets/66f0700c-9312-40b9-b3ae-11edcaec7562"
/>