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

Fix bug where images within code blocks are being flagged #83

Merged
merged 1 commit into from
Oct 4, 2023

Conversation

khiga8
Copy link
Contributor

@khiga8 khiga8 commented Oct 4, 2023

Relates to: github/accessibility-alt-text-bot#33

Currently, this lint rule flags images within code blocks/

This PR updates the rule to make use of the AST by filtering the relevant tokens, and regex match against those tokens instead of just line regex matching.

I used the debug tab of markdown-it to view the AST.

@khiga8 khiga8 marked this pull request as ready for review October 4, 2023 17:52
@khiga8 khiga8 requested a review from a team as a code owner October 4, 2023 17:52
Copy link
Contributor

@kendallgassner kendallgassner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for getting this fixed so quickly 💟

@khiga8 khiga8 merged commit 8a36c24 into main Oct 4, 2023
3 checks passed
@khiga8 khiga8 deleted the kh-fix-bug branch October 4, 2023 20:33
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.

2 participants