From 6b90944736771cde450fade8b0b368ef7cd3915b Mon Sep 17 00:00:00 2001 From: Patrick Wehbe Date: Sat, 20 Jun 2026 22:50:17 +0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20Fix=20out-of-range=20highlight?= =?UTF-8?q?=20lines=20in=20docs=20code=20embeds?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Three docs `{* file hl[a:b] *}` embeds set the inclusive upper bound one line past the end of the referenced file: - `advanced/response-headers.md`: `hl[10:12]` -> `hl[10:11]` (`docs_src/response_headers/tutorial001_py310.py` is 11 lines) - `advanced/websockets.md`: `hl[48:52]` -> `hl[48:51]` (`docs_src/websockets_/tutorial001_py310.py` is 51 lines) - `tutorial/body-updates.md`: `hl[28:33]` -> `hl[28:32]` (`docs_src/body_updates/tutorial001_py310.py` is 32 lines) The rendered output is unchanged since the nonexistent trailing line was silently dropped; this corrects the ranges to the intended last line. --- docs/en/docs/advanced/response-headers.md | 2 +- docs/en/docs/advanced/websockets.md | 2 +- docs/en/docs/tutorial/body-updates.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/en/docs/advanced/response-headers.md b/docs/en/docs/advanced/response-headers.md index cbc28e495..ea541b3ca 100644 --- a/docs/en/docs/advanced/response-headers.md +++ b/docs/en/docs/advanced/response-headers.md @@ -22,7 +22,7 @@ You can also add headers when you return a `Response` directly. Create a response as described in [Return a Response Directly](response-directly.md) and pass the headers as an additional parameter: -{* ../../docs_src/response_headers/tutorial001_py310.py hl[10:12] *} +{* ../../docs_src/response_headers/tutorial001_py310.py hl[10:11] *} /// note | Technical Details diff --git a/docs/en/docs/advanced/websockets.md b/docs/en/docs/advanced/websockets.md index 6f4603e6a..81d12b68b 100644 --- a/docs/en/docs/advanced/websockets.md +++ b/docs/en/docs/advanced/websockets.md @@ -58,7 +58,7 @@ You could also use `from starlette.websockets import WebSocket`. In your WebSocket route you can `await` for messages and send messages. -{* ../../docs_src/websockets_/tutorial001_py310.py hl[48:52] *} +{* ../../docs_src/websockets_/tutorial001_py310.py hl[48:51] *} You can receive and send binary, text, and JSON data. diff --git a/docs/en/docs/tutorial/body-updates.md b/docs/en/docs/tutorial/body-updates.md index e45f96c16..978b33718 100644 --- a/docs/en/docs/tutorial/body-updates.md +++ b/docs/en/docs/tutorial/body-updates.md @@ -6,7 +6,7 @@ To update an item you can use the [HTTP `PUT`](https://developer.mozilla.org/en- You can use the `jsonable_encoder` to convert the input data to data that can be stored as JSON (e.g. with a NoSQL database). For example, converting `datetime` to `str`. -{* ../../docs_src/body_updates/tutorial001_py310.py hl[28:33] *} +{* ../../docs_src/body_updates/tutorial001_py310.py hl[28:32] *} `PUT` is used to receive data that should replace the existing data.