Skip to content

HTML Attributes #655

Answered by colinodell
gavinhow asked this question in Q&A
Discussion options

You must be logged in to vote

Gotcha!

You could extend/replace CloseBracketParser with something that parses and adds the necessary classes, but I must admit it's not the most developer-friendly thing to override. The methods inside of here may change in any future 0.x or 1.0 release, so you would need to be extra careful when upgrading to newer versions of this library.

Another potential approach could be implementing your own document processor that iterates through the AST, identifies Image elements, and adds the necessary attributes. The downside is that this won't have access to the original Markdown syntax, so that would make it slightly difficult to determine when to add different types of classes/attributes.

I…

Replies: 4 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by colinodell
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question General questions about the project or usage
2 participants
Converted from issue

This discussion was converted from issue #309 on June 12, 2021 14:06.