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

Skip default role check for multiline roles in tables #65

Merged
merged 1 commit into from
Jun 27, 2023

Conversation

ezio-melotti
Copy link
Collaborator

This PR fixes an issue that came up in python/devguide#1119 (see sphinx-lint log): when a link or a default role spans multiple lines in a table, it might get incorrectly reported, even if it's valid.

Several checkers already have a similar condition to ignore tables, however adding the same condition has a few limitations:

  1. it only works for tables that have more than 3 columns
  2. it might end up ignoring invalid markup on a single line within the same cell

Because of this, I made the check a bit more sophisticated, decreased the limit from >3 to >2 columns, added a test for the failure seen in the PR linked above, and an additional test to verify that invalid markup on a single line within the same cell is still detected. The other checkers should probably be updated too, possibly factoring out the condition.

@JulienPalard JulienPalard merged commit 4ec2ecb into sphinx-contrib:main Jun 27, 2023
18 checks passed
@JulienPalard
Copy link
Collaborator

Thanks!

@ezio-melotti ezio-melotti deleted the default-roles-tables branch June 27, 2023 16:46
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

Successfully merging this pull request may close these issues.

None yet

2 participants