webhook / webhook-generate

Grunt Static File Generator
MIT License
21 stars 28 forks source link

dirty filter hack to add class to markdown image block #34

Closed kenzik closed 9 years ago

kenzik commented 9 years ago

This is a very simple filter that iterates each line of text and mangles alt="this is the alt|classes here" into alt="this is the alt" class="classes here", eg:

{{ item.content | markdown | imgAltClass }}

Ideally, and IMO, marked should be replaced with something that supports Markdown Extras, so you can use the {.class key=val} stuff, but I think this will suffice for now.

kenzik commented 9 years ago

Oops, missed end tag :-) Closing.