Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lineno gets shifted if rst_prolog is present #1349

Open
MaximilianSoerenPollak opened this issue Nov 15, 2024 · 0 comments
Open

Lineno gets shifted if rst_prolog is present #1349

MaximilianSoerenPollak opened this issue Nov 15, 2024 · 0 comments

Comments

@MaximilianSoerenPollak
Copy link

I have encountered a bug where the lineno options inside the NeedsInfoType is offset if there is an rst_prolog specified that isn't empty.
The offset seems to be exactly the lines of the rst_prolog + 1.

A quick fix if you need it (for example in location of warnigns) is to count the rst_prolog newlines add 1 and subtract that from the lineno.
Kind of like this: correct_line_nr = int(need['lineno']) - rst_prolog_len

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

No branches or pull requests

1 participant