Skip to content

Commit 919febc

Browse files
authored
Update docs for Markdown code block formatting (#23871)
1 parent 055fb30 commit 919febc

1 file changed

Lines changed: 4 additions & 8 deletions

File tree

docs/formatter.md

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -230,14 +230,10 @@ def f(x):
230230
*This feature is currently only available in [preview mode](preview.md#preview).*
231231

232232
The Ruff formatter can also format Python code blocks in Markdown files.
233-
In these files, Ruff will format any CommonMark [fenced code blocks][]
234-
with the following info strings: `python`, `py`, `python3`, `py3`, or `pyi`.
235-
Fenced code blocks without an info string are assumed to be Python code examples
236-
and will also be formatted.
237-
238-
If a code example is recognized and treated as Python, the Ruff formatter will
239-
automatically skip it if the code does not parse as valid Python or if the
240-
reformatted code would produce an invalid Python program.
233+
In these files, Ruff will format any CommonMark [fenced code blocks][] with
234+
the following info strings: `python`, `py`, `python3`, `py3`, or `pyi`. The
235+
formatter will automatically skip a code block if the code does not parse as
236+
valid Python or if the reformatted code would produce an invalid Python program.
241237

242238
Code blocks marked as `python`, `py`, `python3`, or `py3` will be formatted with
243239
the normal Python code formatting style, while any code blocks marked with

0 commit comments

Comments
 (0)