Ejemplo n.º 1
0
        protected async Task <MarkdownDocument> ExtractVersionDocument(MarkdownStream changelogMarkdown)
        {
            using var reader = new StreamReader(changelogMarkdown.Stream, leaveOpen: true);
            var text = await reader.ReadToEndAsync();

            var document = Markdown.Parse(text);
            var nodes    = ExtractDocumentBlocksDestructively(document).ToList();

            var sectionDocument = new MarkdownDocument();

            foreach (var block in nodes)
            {
                sectionDocument.Add(block);
            }

            return(sectionDocument);
        }
Ejemplo n.º 2
0
        public async Task <MarkdownText> ExtractVersionSection(MarkdownStream changelogMarkdown)
        {
            var sectionDocument = await ExtractVersionDocument(changelogMarkdown);

            return(new MarkdownText(RenderToString(sectionDocument)));
        }