예제 #1
0
        public ActionResult Index(int id)
        {
            var topic = _topicRepo.Retrive(id);

            if (topic == null)
            {
                return(HttpNotFound());
            }


            // Create new markdown instance
            var markdownConverter = new Markdown();

            markdownConverter.AddExtension(new GfmCodeBlocks(markdownConverter));
            var showModel = new TopicShowModel
            {
                Id              = topic.Id,
                Title           = topic.Title,
                MarkdownContent = topic.Content,
                HtmlContent     = markdownConverter.Transform(topic.Content)
            };

            return(View(showModel));
        }