Plugin Author needs help with Jekyll API

Hi! Any contributors or plugin authors familiar with the context object that jekyll provides to custom liquid tags?

I maintain Jekyll Picture Tag, which among other things takes in a liquid tag and returns HTML. Sometimes, Kramdown gets grumpy about said HTML and mangles it, necessitating {::nomarkdown} tags surrounding its output.

I need to know when the tag’s output will be parsed by Kramdown. If it is, I have to wrap it in {::nomarkdown} tags. If not, I can’t wrap it or they’ll wind up floating around in the generated site.

I’m having a bear of a time detecting this situation. I’m currently looking at the page name and extension, which mostly works but returns a false positive when called from an HTML layout that’s used by a markdown file.

I could just make it a configuration option (and probably will regardless), but I’d really like to autodetect accurately if possible.

I really appreciate any tips!