示例#1
0
文件: Md.cs 项目: sanyabas/clean-code
        public string RenderToHtml(string markdown)
        {
            tokenizer = new TokenReader(markdown, BaseAddress, HtmlClass);
            var result = tokenizer.ReadTokens().Select(token => token.Text);

            return(string.Join("", result));
        }
示例#2
0
        public string RenderToHtml(string markdown)
        {
            if (markdown == null)
            {
                throw new ArgumentNullException(nameof(markdown));
            }
            var reader   = new TokenReader(new MdLanguage(), markdown);
            var token    = new CompoundToken(reader.ReadTokens());
            var renderer = new HtmlTokenRenderer();

            return(renderer.Render(token));
        }