A bug in table parsing in v0.24 #442

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

Originally created by @belgaard on GitHub (Mar 24, 2021).

A found an issue when I upgraded to v0.24 - v0.23 works fine. I parse MarkDown files and look for tables. In some cases, the parser missed the last table in a document. I narrowed it down to the following,

        [Test]
        public void TestTableBug()
        {
            const string testData = @"
| S | 
|---|
| G |

| D | D |
|---|---| 
| V | V |";
            MarkdownDocument document = Markdown.Parse(testData, new MarkdownPipelineBuilder().UseAdvancedExtensions().Build());

            Table[] tables = document.Descendants().OfType<Table>().ToArray();

            Assert.AreEqual(2, tables.Length, "Did you upgrade to MarkDig > 0.23?");
        }
Originally created by @belgaard on GitHub (Mar 24, 2021). A found an issue when I upgraded to v0.24 - v0.23 works fine. I parse MarkDown files and look for tables. In some cases, the parser missed the last table in a document. I narrowed it down to the following, ``` [Test] public void TestTableBug() { const string testData = @" | S | |---| | G | | D | D | |---|---| | V | V |"; MarkdownDocument document = Markdown.Parse(testData, new MarkdownPipelineBuilder().UseAdvancedExtensions().Build()); Table[] tables = document.Descendants().OfType<Table>().ToArray(); Assert.AreEqual(2, tables.Length, "Did you upgrade to MarkDig > 0.23?"); } ```
claunia added the bug label 2026-01-29 14:36:55 +00:00
Author
Owner

@xoofx commented on GitHub (Mar 24, 2021):

Might be related to #481 (cc: @generateui)

@xoofx commented on GitHub (Mar 24, 2021): Might be related to #481 (cc: @generateui)
Author
Owner

@generateui commented on GitHub (Mar 29, 2021):

I'll take a look.

@generateui commented on GitHub (Mar 29, 2021): I'll take a look.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/markdig#442