--publish -> --render
force markdown output with --render
fix dequote for short strings
use Attribute object
use figure div for output figures
don't put caption in div attrs

I'm not sure that k="v" with spaces in the v is allowed at all.