Insert custom html after paragraph #519

Open
opened 2026-01-29 14:38:37 +00:00 by claunia · 0 comments
Owner

Originally created by @hey-red on GitHub (Mar 26, 2022).

There is way to insert html container after paragraph?

var markdownPipeline = new MarkdownPipelineBuilder().UseAutoLinks().Build();

var document = Markdown.Parse("https://github.com/xoofx/markdig", _markdownPipeline);

var autoLinks = document
    .Descendants<LinkInline>()
    .Where(link => !link.IsImage && !link.IsShortcut && link.IsAutoLink);

foreach (var autoLink in autoLinks) 
{
    if (autoLink.Parent?.ParentBlock is ParagraphBlock paragraph)
    {
        // Insert raw html after paragraph
    }
}
Originally created by @hey-red on GitHub (Mar 26, 2022). There is way to insert html container after paragraph? ```C# var markdownPipeline = new MarkdownPipelineBuilder().UseAutoLinks().Build(); var document = Markdown.Parse("https://github.com/xoofx/markdig", _markdownPipeline); var autoLinks = document .Descendants<LinkInline>() .Where(link => !link.IsImage && !link.IsShortcut && link.IsAutoLink); foreach (var autoLink in autoLinks) { if (autoLink.Parent?.ParentBlock is ParagraphBlock paragraph) { // Insert raw html after paragraph } } ```
claunia added the question label 2026-01-29 14:38:37 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/markdig#519