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

Fixes "alt" tag not showing, when images option is used #210

Merged
merged 2 commits into from
Dec 29, 2023

Conversation

benwinding
Copy link
Contributor

@benwinding benwinding commented Dec 3, 2023

Problem

When using the images: config option, the alt tag doesn't get added to the attributes.

Steps to Reproduce

  • Set images in hexo _config.yml file
markdown:
  images:
    lazyload: true // Need at least one option, this is just an example
  • Note the generated <img .../> tags in HTML don't have any alt attributes

Fix

Use the token.content which contains the "alt text" from the markdown image.

Example markdown image
image

What's available in the context during debugging
image

Note: I'm not sure if it would be better to fix this up the call-chain 🤷

benwinding and others added 2 commits December 3, 2023 21:40
Issue -> hexojs/hexo-renderer-markdown-it/hexojs#205
Copy link
Member

@uiolee uiolee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@yoshinorin yoshinorin merged commit f8dee44 into hexojs:master Dec 29, 2023
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

When using post asset folders, alternate texts are removed from images
3 participants