mattcone / markdown-guide

The comprehensive Markdown reference guide.
https://www.markdownguide.org
MIT License
3.29k stars 618 forks source link

Images alt text #200

Open fconil opened 2 months ago

fconil commented 2 months ago

Hi, Thanks for your site that I use as my Markdown syntax reference.

I saw in Basic syntax as well as in the reference implementation documentation that alt text is the text inside the brackets. But that's not what I see on your page or with my MkDoc framework.

It seems that it is the Title which is in quotation marks after the path or URL that is used as alternate text.

I do not know was it made of the text that is placed inside the brackets.

Did I missed something ?

Regards

wyattscarpenter commented 1 month ago

Hi @fconil,

I'm not the author of this project, but I was looking into this today and I believe the basic syntax description is correct.

Here's an example from basic syntax

image

Here's what the html looks like when I inspect element in firefox:

<img
srcset="https://mdg.imgix.net/assets/images/san-juan-mountains.jpg?auto=format&amp;fit=clip&amp;w=480 480w,
              https://mdg.imgix.net/assets/images/san-juan-mountains.jpg?auto=format&amp;fit=clip&amp;q=40&amp;w=1080 1080w"
             src="https://mdg.imgix.net/assets/images/san-juan-mountains.jpg"
             class="img-fluid"
             title="San Juan Mountains"
             alt="The San Juan Mountains are beautiful!"
             loading="lazy"
             sizes="100vw">

As you can see, it is the title that is in quotation marks after the path or URL that gets used as the title html attribute, which also displays on hover. The alt text is the text inside the brackets, and it would display if the image failed to display.

Hope this helps!