Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
raulcristiann opened this issue Apr 15, 2022 · 2 comments
Labels

Comments

@raulcristiann
Copy link

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?
    }
}
@xoofx
Copy link
Owner

xoofx commented 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 xoofx added the bug label Apr 15, 2022
xoofx added a commit that referenced this issue Apr 20, 2022
@xoofx
Copy link
Owner

xoofx commented Apr 20, 2022

Fixed by commit fcc7369

@xoofx xoofx closed this as completed Apr 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants