More agressively set the context for our custom Markdown renderer, and fall back if we still don't manage to get it right. Fixes #662.