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

need2list results in incorrect source mapping #1323

Open
chrisjsewell opened this issue Oct 8, 2024 · 0 comments
Open

need2list results in incorrect source mapping #1323

chrisjsewell opened this issue Oct 8, 2024 · 0 comments
Assignees
Labels

Comments

@chrisjsewell
Copy link
Member

From a parsing perspective, the code in https://github.com/useblocks/sphinx-needs/blob/master/sphinx_needs/directives/list2need.py is currently pretty horrible:
because it completely re-generates the text then uses self.state_machine.insert_input to insert the text into the text stream,
not only is this incompatible with non-rST parsers like MyST,
it also completely breaks any source mapping within that file; for both warnings and needs data
(see e.g. https://github.com/useblocks/sphinx-needs/blob/master/tests/__snapshots__/test_list2need.ambr)

There is a much better, "proper", way to do this I believe; using the new generate_need function and parsing the content with nested parsing,
I would like to do this, but don't have time straight away

@chrisjsewell chrisjsewell self-assigned this Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant