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

String-rendering bug in docs #9288

Closed
diceroll123 opened this issue Dec 26, 2023 · 3 comments · Fixed by #9301
Closed

String-rendering bug in docs #9288

diceroll123 opened this issue Dec 26, 2023 · 3 comments · Fixed by #9301
Assignees
Labels
bug Something isn't working documentation Improvements or additions to documentation

Comments

@diceroll123
Copy link
Contributor

It seems that the docs message for FURB118 is cut off.

image

But the format string in the code is

format!("Use `operator.{operator}` instead of defining a {target}")
@charliermarsh charliermarsh added documentation Improvements or additions to documentation bug Something isn't working labels Dec 26, 2023
@charliermarsh charliermarsh self-assigned this Dec 28, 2023
@charliermarsh
Copy link
Member

Something happening in the Markdown-to-HTML conversion, maybe some lack of escaping?

@charliermarsh
Copy link
Member

The Markdown looks right, but un-backticked format placeholders are missing upon conversion to HTML.

@charliermarsh
Copy link
Member

It's probably the attr_list extension, the last {} placeholder is being treated as an HTML attribute.

charliermarsh added a commit that referenced this issue Dec 28, 2023
## Summary

If a rule ends with a trailing placeholder (like "Use {target}"), that
gets interpreted as an HTML attribute adding, `target="target"` to the
node. This PR escapes such cases. In reality, they're rare, since we
almost always wrap placeholders in backticks, which avoids this problem
-- but in some cases, they are in fact correct to be un-backticked.

Closes #9288.

## Test Plan

<img width="673" alt="Screen Shot 2023-12-28 at 9 33 40 AM"
src="https://github.com/astral-sh/ruff/assets/1309177/14aaa168-c802-4258-b82d-217a85b42ebf">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants