Esempio n. 1
0
        protected override void Write(PlainTextRenderer renderer, ListBlock listBlock)
        {
            renderer.EnsureLine();

            foreach (var item in listBlock)
            {
                renderer.EnsureLine();

                renderer.WriteChildren((ListItemBlock)item);
            }
        }
Esempio n. 2
0
        protected override string GetPlainTextBody()
        {
            var markdown = GetMarkdownBody();

            var writer   = new StringWriter();
            var pipeline = new MarkdownPipelineBuilder().Build();

            // We override the renderer with our own writer
            var renderer = new PlainTextRenderer(writer);

            pipeline.Setup(renderer);

            var document = Markdown.Parse(markdown, pipeline);

            renderer.Render(document);
            writer.Flush();

            return(writer.ToString());
        }