📝 Fix out-of-range highlight lines in docs code embeds#15814
Open
patrickwehbe wants to merge 1 commit into
Open
📝 Fix out-of-range highlight lines in docs code embeds#15814patrickwehbe wants to merge 1 commit into
patrickwehbe wants to merge 1 commit into
Conversation
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.
Contributor
📝 Docs previewLast commit 6b90944 at: https://6140ee11.fastapitiangolo.pages.dev Modified Pages |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three docs
{* file hl[a:b] *}embeds set the inclusivehlupper bound one line past the end of the referenced file. In each case the intended block ends at the file's last line, so the upper bound should be one lower.docs/en/docs/advanced/response-headers.mddocs_src/response_headers/tutorial001_py310.pyhl[10:12]hl[10:11]docs/en/docs/advanced/websockets.mddocs_src/websockets_/tutorial001_py310.pyhl[48:52]hl[48:51]docs/en/docs/tutorial/body-updates.mddocs_src/body_updates/tutorial001_py310.pyhl[28:33]hl[28:32]The corrected ranges still cover the same intended code (the response/header lines, the WebSocket endpoint body, and the
PUThandler respectively).The rendered docs are not affected: the phantom line is past end-of-file and was silently dropped, so the highlighted output already looked correct. This is just a range-correctness fix so the embed bounds match the files they point at.