refine diagrams for markdown