webhook / webhook-generate

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

down and dirty filter to use a pipe delimiter in markdown image descr… #35

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

@gpbmike @snide @LtSquigs - Thoughts on this PR?

snide commented 9 years ago

Ian and I talked about it today. It IS a hack, but to be honest so are all the markdown "extra" libraries. Ian will give this a test later tonight.

kenzik commented 9 years ago

Understood. The goal was to not interfere with anything else, but rather to just provide a dirty regexp to reformat the image alt tags from the marked output (via the WH "markdown" filter.)