mirror of
https://github.com/xoofx/markdig.git
synced 2026-02-04 05:44:50 +00:00
Fix bug when a thematic break is inside a fenced code block inside a pending list (#164)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
// Copyright (c) Alexandre Mutel. All rights reserved.
|
||||
// This file is licensed under the BSD-Clause 2 license.
|
||||
// This file is licensed under the BSD-Clause 2 license.
|
||||
// See the license.txt file in the project root for more information.
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -19,6 +19,25 @@ namespace Markdig.Tests
|
||||
TestSpec(markdownText, "<p><em>Unlimited-Fun®</em>®</p>");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestThematicInsideCodeBlockInsideList()
|
||||
{
|
||||
var input = @"1. In the :
|
||||
|
||||
```
|
||||
Id DisplayName Description
|
||||
-- ----------- -----------
|
||||
62375ab9-6b52-47ed-826b-58e47e0e304b Group.Unified ...
|
||||
```";
|
||||
TestSpec(input, @"<ol>
|
||||
<li><p>In the :</p>
|
||||
<pre><code>Id DisplayName Description
|
||||
-- ----------- -----------
|
||||
62375ab9-6b52-47ed-826b-58e47e0e304b Group.Unified ...
|
||||
</code></pre></li>
|
||||
</ol>");
|
||||
}
|
||||
|
||||
public static void TestSpec(string inputText, string expectedOutputText, string extensions = null)
|
||||
{
|
||||
foreach (var pipeline in GetPipeline(extensions))
|
||||
|
||||
@@ -86,7 +86,7 @@ namespace Markdig.Parsers
|
||||
// interpretations of a line, the thematic break takes precedence
|
||||
BlockState result;
|
||||
var thematicParser = ThematicBreakParser.Default;
|
||||
if (thematicParser.HasOpeningCharacter(processor.CurrentChar))
|
||||
if (!(processor.LastBlock is FencedCodeBlock) && thematicParser.HasOpeningCharacter(processor.CurrentChar))
|
||||
{
|
||||
result = thematicParser.TryOpen(processor);
|
||||
if (result.IsBreak())
|
||||
|
||||
Reference in New Issue
Block a user