Skip to content

Is it possible to set height and width attributes while building an Image mdast node? #115

Answered by ChristianMurphy
reypm asked this question in Q&A
Discussion options

You must be logged in to vote

Heya @reypm 👋

is there any way that I can pass those two max-height and max-width to be height and width for the HTML img attributes?

Yes, by using data.hProperties on the newly created MDAST image node, you can add any HTML property you would like.
Similar to how you used it to add className in your last discussion thread https://github.com/orgs/syntax-tree/discussions/113#discussion-5544677

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by reypm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants