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

When searching execute, link to scroll to text fragment doesn't work due to incorrect fragment #1954

Open
alexgmin opened this issue Feb 19, 2025 · 0 comments

Comments

@alexgmin
Copy link
Contributor

alexgmin commented Feb 19, 2025

Due to this PR the docs search now has scroll to text.

When searching execute: https://docs.djangoproject.com/en/5.1/search/?q=execute

The second option, "Performing raw SQL queries", links to
https://docs.djangoproject.com/en/5.1/topics/db/sql/#:~:text=execute%28%22UPDATE%20bar%20SET%20foo%20%3D%201%20WHERE%20baz%20%3D%20%25s%20%22%2C%5Bself.%20baz%5D%29
Decoded: https://docs.djangoproject.com/en/5.1/topics/db/sql/#:~:text=execute("UPDATE bar SET foo = 1 WHERE baz = %s ",[self. baz])
However this doesn't scroll to the place.
The correct one should be this one
https://docs.djangoproject.com/en/5.1/topics/db/sql/#:~:text=execute(%22UPDATE%20bar%20SET%20foo%20%3D%201%20WHERE%20baz%20%3D%20%25s%22,%20[self.baz])
Decoded: https://docs.djangoproject.com/en/5.1/topics/db/sql/#:~:text=execute("UPDATE bar SET foo = 1 WHERE baz = %s", [self.baz])

There are two differences:

  • Extra space after: WHERE baz = %s
  • Extra space after the dot: [self. baz])

I haven't dug further on why is this happening, whether is a fragment issue only or is an indexing issue that just happens to show up on this feature

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