Extra LineBreakInline starting with version 0.26.0 targeting .NetFramework 4.7 #525

Closed
opened 2026-01-29 14:38:45 +00:00 by claunia · 2 comments
Owner

Originally created by @raulcristiann on GitHub (Apr 15, 2022).

Looks like you're adding an extra LineBreakInline. Is this intended?
Code:

using System;
using Markdig;
using Markdig.Syntax;

public class Program
{
    public static void Main()
    {
        var pipeline = new MarkdownPipelineBuilder()
               .UseAdvancedExtensions()
               .Build();

        var text = @"
text  
other text

new\
new 2

other
other 2

1other 
1other 2
";
        var document = Markdown.Parse(text, pipeline);
        var containerBlock = (ContainerBlock)document;
        var parahraphBlock = (ParagraphBlock)containerBlock[1];
        var inlines = parahraphBlock.Inline;
        foreach (var inline in inlines)
        {
            Console.WriteLine(inline);
        }
        Console.ReadKey();


        //Starting with version 0.26.0 the result is:
        //new
        //Markdig.Syntax.Inlines.LineBreakInline
        //Markdig.Syntax.Inlines.LineBreakInline
        //new 2

        //Starting with version 0.26.0 (With EnableTrackTrivia) the result is:
        //new
        //Markdig.Syntax.Inlines.LineBreakInline
        //Markdig.Syntax.Inlines.LineBreakInline
        //new 2
        //Markdig.Syntax.Inlines.LineBreakInline

        //0.24.0 version result:
        //new\
        //Markdig.Syntax.Inlines.LineBreakInline
        //new 2

        //0.23.0 version result:
        //new
        //Markdig.Syntax.Inlines.LineBreakInline
        //new 2

        //Why do we have 2 "Markdig.Syntax.Inlines.LineBreakInline" in the latest version?
    }
}
Originally created by @raulcristiann on GitHub (Apr 15, 2022). Looks like you're adding an extra LineBreakInline. Is this intended? Code: ``` using System; using Markdig; using Markdig.Syntax; public class Program { public static void Main() { var pipeline = new MarkdownPipelineBuilder() .UseAdvancedExtensions() .Build(); var text = @" text other text new\ new 2 other other 2 1other 1other 2 "; var document = Markdown.Parse(text, pipeline); var containerBlock = (ContainerBlock)document; var parahraphBlock = (ParagraphBlock)containerBlock[1]; var inlines = parahraphBlock.Inline; foreach (var inline in inlines) { Console.WriteLine(inline); } Console.ReadKey(); //Starting with version 0.26.0 the result is: //new //Markdig.Syntax.Inlines.LineBreakInline //Markdig.Syntax.Inlines.LineBreakInline //new 2 //Starting with version 0.26.0 (With EnableTrackTrivia) the result is: //new //Markdig.Syntax.Inlines.LineBreakInline //Markdig.Syntax.Inlines.LineBreakInline //new 2 //Markdig.Syntax.Inlines.LineBreakInline //0.24.0 version result: //new\ //Markdig.Syntax.Inlines.LineBreakInline //new 2 //0.23.0 version result: //new //Markdig.Syntax.Inlines.LineBreakInline //new 2 //Why do we have 2 "Markdig.Syntax.Inlines.LineBreakInline" in the latest version? } } ```
claunia added the bug label 2026-01-29 14:38:45 +00:00
Author
Owner

@xoofx commented on GitHub (Apr 15, 2022):

Why do we have 2 "Markdig.Syntax.Inlines.LineBreakInline" in the latest version?

It's a probably a bug and side effect of the EnableTrackTrivia work, even when not active, it changed many parts of the parser.

@xoofx commented on GitHub (Apr 15, 2022): > Why do we have 2 "Markdig.Syntax.Inlines.LineBreakInline" in the latest version? It's a probably a bug and side effect of the EnableTrackTrivia work, even when not active, it changed many parts of the parser.
Author
Owner

@xoofx commented on GitHub (Apr 20, 2022):

Fixed by commit fcc7369

@xoofx commented on GitHub (Apr 20, 2022): Fixed by commit fcc7369
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/markdig#525