When you have an image in Prismic, if there is no alternative text, the alt attribute built from Fragment.Image#asHtml method is the string "null" instead of an empty string.
This PR fix this behavior: when the alternative text is empty, image alt attribute is now "".
Omitting 'alt' attribute altogether indicates that the image is a key part of the content, and no textual equivalent is available. Setting this attribute to an empty string (alt="") indicates that this image is not a key part of the content, and that non-visual browsers may omit it from rendering.
(see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img)
Hello team!
When you have an image in Prismic, if there is no alternative text, the
alt
attribute built fromFragment.Image#asHtml
method is the string"null"
instead of an empty string. This PR fix this behavior: when the alternative text is empty, image alt attribute is now""
.This PR depends on #56
Thanks and happy hacktoberfest!