github / accessibility-alt-text-bot

An action to remind users to add alt text on Issues, Pull Requests, and Discussions
MIT License
74 stars 13 forks source link

Use AST parser to validate alt text - Remark #32

Closed kendallgassner closed 11 months ago

kendallgassner commented 11 months ago

What

Closes #30

I updated the alt-text-bot to use an AST (remark) to parse images for bad alt text. Using an AST allows us to ignore any images defined in code blocks.

Why is this cool

TODO

Testing

If you find it useful I used AST Explorer to test remark output.

khiga8 commented 11 months ago

Excited to see this! First question -- is there a reason you went with remark over markdownlint? I would personally prefer the latter because it already comes with the no alt text rule.

We also have additional rules in markdownlint-github like no-default-alt-text for flagging screenshots, and there are plans to add more rules soon! I would prefer if we align on markdownlint so we can use the existing rules!

kendallgassner commented 11 months ago

Remark:

I see the value in using a rule set GitHub has worked on though 🤔 ... Do we have more than the two rules?

cc. @khiga8