Skip to content

Astro Markdown doesn't render empty alt attribute properly #4470

@marcosmartini

Description

@marcosmartini

What version of astro are you using?

1.0.8

Are you using an SSR adapter? If so, which one?

No

What package manager are you using?

npm

What operating system are you using?

Mac

Describe the Bug

When using the astro flavoured markdown, if you add an image and add an empty alt attribute to it, instead of rendering <img alt="" />, it will render with extra quotes like <img alt="""" />. This can be problematic for accessibility since the recommendation when rendering an image that should be ignored by screenreaders is to add alt="".

Cheers,
Marcos.

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-uvm4y1?file=src/layouts/Layout.astro

Participation

  • I am willing to submit a pull request for this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    - P2: nice to haveNot breaking anything but nice to have (priority)

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions