-
-
Notifications
You must be signed in to change notification settings - Fork 4
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
Support separate alt text and captions in Markdown content #14
Conversation
…er support for Alt text from markdown besides caption text
✅ Deploy Preview for spyder-svelte-website-preview ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, except that the captions are retained in the alt text field. Simply leaving it empty would be a better alternative, as it avoids repeating the same thing twice that does not replace or describe the actual content of the image.
Given there are a relatively small number of them and they are being modified anyway, I just went ahead and wrote alt text for them, leaving it as suggestions you can apply.
Co-authored-by: C.A.M. Gerlach <[email protected]>
Co-authored-by: C.A.M. Gerlach <[email protected]>
Co-authored-by: C.A.M. Gerlach <[email protected]>
Co-authored-by: C.A.M. Gerlach <[email protected]>
Co-authored-by: C.A.M. Gerlach <[email protected]>
Co-authored-by: C.A.M. Gerlach <[email protected]>
Co-authored-by: C.A.M. Gerlach <[email protected]>
Co-authored-by: C.A.M. Gerlach <[email protected]>
Co-authored-by: C.A.M. Gerlach <[email protected]>
…d in the alt text of an image
… part of the experiments to fix the issue with double quotes, and it's interfering with metadata fields from the blog posts in the build process. Will investigate further
rehype-figure
with rehype-title-figure
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM now, thanks @conradolandia !
This PR replaces a plugin to add support for proper Alt text from markdown sources using mdsvex. The new plugin is
rehype-title-figure
.With this new implementation,
![This is alt text](image.jpg "This is the caption")
will render like<figure><img src="image.jpg" alt="This is alt text" title="This is the caption"/><figcaption>This is the caption</figcaption></figure>
.An image without a caption will not produce a
figure
norfigcaption
, but will produce animg
with an alt attribute:![This is alt text](image.jpg)
will render like<img src="image.jpg" alt="This is alt text" />
.