Add attributes to images? #1403
Unanswered
dmca-glasgow
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Hey! https://github.com/remarkjs/remark-directive comes close. MDX (https://mdxjs.com/packages/remark-mdx/) also enabled this. You could also make a plugin that does this but with comments: |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'd like to achieve something like:
Where I can hardcode data attributes for images in the Markdown. The syntax doesn't need to be exactly this, just some way to gain access to the custom attributes in the
mdast
.I haven't found a plugin with this ability except remark-attr which hasn't been updated to support recent versions of remark.
This approach is an option, but problematic for URLs with geniune query strings (granted uncommon for images) and the syntax is a little awkward:
Does anyone know of an existing plugin that I could use, before I attempt to make something bespoke?
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions