0d2114e introduced a bug where Markdown writer would ignore attributes on the figure if it has class or key-value attributes set. This commit fixes that and adds a regression test. Closes #10867
0d2114e