This is a cajoled version of Attack Lab's Markdown renderer.