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

MD045: no-alt-text triggered even though html alt-text is specified #1200

Open
skwde opened this issue May 7, 2024 · 2 comments
Open

MD045: no-alt-text triggered even though html alt-text is specified #1200

skwde opened this issue May 7, 2024 · 2 comments
Labels

Comments

@skwde
Copy link

skwde commented May 7, 2024

It seems that this should no longer appear, because support was supposedly added through this issue #992 and related merge request #993.

Though I still get this issue.

With following test.md

![](./image.png){fig-alt="Some image"}

I get

test.md:2:1 MD045/no-alt-text Images should have alternate text (alt text) https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md045.md

after running

markdownlint-cli2 test.md
@DavidAnson
Copy link
Owner

MD045 supports CommonMark syntax for image alternate text (technically the "image description") and the PR referenced above allowed the rule to also recognize alternate text in an HTML IMG tag via the ALT attribute. There are examples of both in the documentation: https://github.com/DavidAnson/markdownlint/blob/main/doc/md045.md

What's shown above in this issue as "fig-alt" is neither of those and therefore not recognized. It looks like this is something Quarto does because it does not use the image description in the standard way: https://quarto.org/docs/authoring/figures.html#alt-text

@DavidAnson
Copy link
Owner

Quarto’s custom format does not work well with CommonMark syntax as it parses like content and is displayed to the user: https://dlaa.me/markdownlint/#%25m%23%20Issue%201200%0A%0A!%5BElephant%5D(elephant.png)%7Bfig-alt%3D%22A%20drawing%20of%20an%20elephant.%22%7D%0A

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants