The following is an idea for an enhancement to Markdown that allows for "YAML frontmatter" intersperced throughout the document. This will allow you to write standard markdown while also supporting more complex data types where necessary.
The idea incldues the ability to "class" your YAML to a specific object type. For example, what follows is an image object that would be rendered according to the specs of the rendering engine.
----image
src: /path/to/image.png
caption: some markdown [caption](#)
credit: a person's name
----