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

Escape trailing placeholders in rule documentation #9301

Merged
merged 1 commit into from
Dec 28, 2023
Merged

Conversation

charliermarsh
Copy link
Member

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

Screen Shot 2023-12-28 at 9 33 40 AM

@charliermarsh charliermarsh added the bug Something isn't working label Dec 28, 2023
Copy link
Contributor

ruff-ecosystem results

Formatter (stable)

ℹ️ ecosystem check encountered format errors. (no format changes; 2 project errors)

pypa/setuptools (error)

ruff failed
  Cause: 'quote-style = preserve' is a preview only feature. Run with '--preview' to enable it.

sphinx-doc/sphinx (error)

warning: The following rules may cause conflicts when used with the formatter: `COM812`. To avoid unexpected behavior, we recommend disabling these rules, either by removing them from the `select` or `extend-select` configuration, or adding them to the `ignore` configuration.
warning: The `flake8-quotes.inline-quotes="single"` option is incompatible with the formatter's `format.quote-style="double"`. We recommend disabling `Q000` and `Q003` when using the formatter, which enforces a consistent quote style. Alternatively, set both options to either `"single"` or `"double"`.
warning: Detected debug build without --no-cache.
error: Failed to read tests/roots/test-pycode/cp_1251_coded.py: stream did not contain valid UTF-8

Formatter (preview)

ℹ️ ecosystem check encountered format errors. (no format changes; 1 project error)

sphinx-doc/sphinx (error)

ruff format --preview

warning: The following rules may cause conflicts when used with the formatter: `COM812`. To avoid unexpected behavior, we recommend disabling these rules, either by removing them from the `select` or `extend-select` configuration, or adding them to the `ignore` configuration.
warning: The `flake8-quotes.inline-quotes="single"` option is incompatible with the formatter's `format.quote-style="double"`. We recommend disabling `Q000` and `Q003` when using the formatter, which enforces a consistent quote style. Alternatively, set both options to either `"single"` or `"double"`.
warning: Detected debug build without --no-cache.
error: Failed to read tests/roots/test-pycode/cp_1251_coded.py: stream did not contain valid UTF-8

@charliermarsh charliermarsh merged commit 465f835 into main Dec 28, 2023
17 checks passed
@charliermarsh charliermarsh deleted the charlie/html branch December 28, 2023 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

String-rendering bug in docs
1 participant