From b1d6f34976b965a982f624a4326cd65315d24b1f Mon Sep 17 00:00:00 2001 From: Nick Pearson Date: Wed, 14 Jun 2017 15:20:16 -0700 Subject: [PATCH] Fix issue in GenericAttributesParser causing inline elements to be skipped --- src/Markdig.Tests/TestPlayParser.cs | 34 +++++++++++++++++++ .../GenericAttributesParser.cs | 2 +- 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/src/Markdig.Tests/TestPlayParser.cs b/src/Markdig.Tests/TestPlayParser.cs index ac9d533a..095f3d63 100644 --- a/src/Markdig.Tests/TestPlayParser.cs +++ b/src/Markdig.Tests/TestPlayParser.cs @@ -157,6 +157,40 @@ Paragraph ", "advanced"); } + [Test] + public void TestGridTableWithCustomAttributes() { + + var pipeline = new MarkdownPipelineBuilder().UseAdvancedExtensions().Build(); + + var input = @" +{.table} ++---+---+ +| a | b | ++===+===+ +| 1 | 2 | ++---+---+ +"; + + var expected = @" +++ + + + + + + + + + + + +
ab
12
+"; + var result = Markdown.ToHtml(input, pipeline); + Assert.AreEqual(result, expected); + } [Test] public void TestSamePipelineAllExtensions() diff --git a/src/Markdig/Extensions/GenericAttributes/GenericAttributesParser.cs b/src/Markdig/Extensions/GenericAttributes/GenericAttributesParser.cs index c612ec8d..0fa4bf20 100644 --- a/src/Markdig/Extensions/GenericAttributes/GenericAttributesParser.cs +++ b/src/Markdig/Extensions/GenericAttributes/GenericAttributesParser.cs @@ -59,7 +59,7 @@ namespace Markdig.Extensions.GenericAttributes { objectToAttach = parent[indexOfParagraph + 1]; // We can remove the paragraph as it is empty - parent.RemoveAt(indexOfParagraph); + paragraph.RemoveAfterProcessInlines = true; } }