Skip to content

fix: versionadded (etc) directives had incorrect paragraph line numbers#14309

Open
nedbat wants to merge 2 commits intosphinx-doc:masterfrom
nedbat:nedbat/fix-versionadded
Open

fix: versionadded (etc) directives had incorrect paragraph line numbers#14309
nedbat wants to merge 2 commits intosphinx-doc:masterfrom
nedbat:nedbat/fix-versionadded

Conversation

@nedbat
Copy link
Contributor

@nedbat nedbat commented Feb 17, 2026

In using the docutils doctree to analyze links in .rst files, I found that the paragraphs following versionadded directives had the wrong line numbers: instead of being the number of the first line of the paragraph, they has the number of the first line after the paragraph.

I believe this fixes the problem.

I don't know why, but without this fix, errors in versionadded paragraphs have the correct line numbers, and with this fix, they still have the correct line numbers. Insights appreciated.

@nedbat nedbat marked this pull request as draft February 17, 2026 10:20
@nedbat
Copy link
Contributor Author

nedbat commented Feb 17, 2026

This doesn't seem to be right yet.

@nedbat nedbat force-pushed the nedbat/fix-versionadded branch from 32b8f75 to f679901 Compare February 17, 2026 10:36
@nedbat nedbat marked this pull request as ready for review February 17, 2026 11:06
@nedbat nedbat force-pushed the nedbat/fix-versionadded branch from a458ae2 to d372e64 Compare February 21, 2026 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant