GoLang port of legal_markdown