[Bug]: Inline html tag </code></pre> convert to wrong result on the latest stable version 0.21.1 #397

Closed
opened 2026-01-29 14:35:43 +00:00 by claunia · 3 comments
Owner

Originally created by @v-caxian on GitHub (Aug 31, 2020).

Issue Description

There is a wrong html encoding that causes the </code></pre> tag to be converted to &lt;/code&gt;&lt;/pre&gt; and it cannot be closed properly.

Repro Steps

using System;
using Markdig;

class Program
{
    static void Main(string[] args)
    {
        var markdown = "<p>The following example writes the number of <xref data-throw-if-not-resolved=\"true\" uid=\"Microsoft.Office.InfoPath.Server.Administration.ExemptUserAgent\"></xref> objects and lists them from the collection. References are required in the Visual Studio project to the <strong>Microsoft.Office.Server</strong>, <strong>Microsoft.Office.InfoPath.Server</strong>, and <strong>Microsoft.SharePoint</strong> assemblies.</p>\r\n<p>\r\n    <strong>Note</strong>: Browse for the <strong>Microsoft.Office.InfoPath.Server</strong> assembly at &lt;drive&gt;:\\Program Files\\Microsoft Office Servers\\14.0\\Bin. The <strong>Microsoft.Office.Server</strong> reference is listed as Microsoft Office Server component and the <strong>Microsoft.SharePoint</strong> reference is listed as Windows SharePoint Services on the .NET tab of the Add Reference dialog box.\r\n</p>\r\n<p>The following <strong>import</strong> statements are required for the</p>\r\n<p>\r\n    <xref data-throw-if-not-resolved=\"true\" uid=\"Microsoft.Office.Server\"></xref>, <xref data-throw-if-not-resolved=\"true\" uid=\"Microsoft.Office.InfoPath.Server.Administration\"></xref>, and <xref data-throw-if-not-resolved=\"true\" uid=\"Microsoft.SharePoint.Administration\"></xref> namespaces:\r\n</p>\r\n<pre><code>    Dim LocalFormsService As FormsService\r\n    Dim LocalFarm As SPFarm\r\n    Dim ExUserAgents As Integer\r\n    Dim ExUserAgent As ExemptUserAgent\r\n    Dim ExUserAgentsCollection As ExemptUserAgentCollection\r\n\r\n    Try\r\n        LocalFarm = SPFarm.Local\r\n        LocalFormsService = LocalFarm.Services.GetValue(Of FormsService)(FormsService.ServiceName)\r\n        ExUserAgents = LocalFormsService.ExemptUserAgents.Count()\r\n        Console.WriteLine(\"Number of exempt user agents: \" &amp;amp; ExUserAgents.ToString())\r\n        ExUserAgentsCollection = LocalFormsService.&lt;span class=\"label\"&gt;ExemptUserAgents&lt;/span&gt;\r\n        For Each ExUserAgent In ExUserAgentsCollection\r\n            Console.WriteLine(ExUserAgent.Name)\r\n        Next\r\n        Console.Write(\"Press Enter to Continue\")\r\n        Console.ReadLine()\r\n    Catch ex As Exception\r\n        Console.WriteLine(\"Error: \" + ex.Message)\r\n        Console.Write(\"Press Enter to Continue\")\r\n        Console.ReadLine()\r\n    End Try</code></pre>\r\n<p>The following <strong>using</strong> statements are required for the <xref data-throw-if-not-resolved=\"true\" uid=\"Microsoft.Office.Server\"></xref>, <xref data-throw-if-not-resolved=\"true\" uid=\"Microsoft.Office.InfoPath.Server.Administration\"></xref>, and <xref data-throw-if-not-resolved=\"true\" uid=\"Microsoft.SharePoint.Administration\"></xref> namespaces.</p>\r\n<pre><code>    FormsService localFormsService;\r\n    SPFarm localFarm = SPFarm.Local;\r\n    Int16 exAgents;\r\n    ExemptUserAgentCollection exUserAgentCollection;\r\n\r\n    try\r\n    {\r\n        localFormsService = localFarm.Services.GetValue&amp;lt;FormsService&amp;gt;(FormsService.ServiceName);\r\n        exAgents = (Int16)localFormsService.ExemptUserAgents.Count;\r\n        Console.WriteLine(\"Number of exempt user agents: \" + exAgents.ToString());\r\n        exUserAgentCollection = localFormsService.&lt;span class=\"label\"&gt;ExemptUserAgents&lt;/span&gt;;\r\n        foreach(ExemptUserAgent exUserAgent in exUserAgentCollection)\r\n        {\r\n            Console.WriteLine(exUserAgent.Name);\r\n        }\r\n        Console.Write(\"Press Enter to Continue\");\r\n        Console.ReadLine();\r\n    }\r\n    catch (Exception ex)\r\n    {\r\n        Console.WriteLine(\"Error: \" + ex.Message);\r\n        Console.Write(\"Press Enter to Continue\");\r\n        Console.ReadLine();\r\n    }</code></pre>";
        var html = Markdown.ToHtml(markdown);
        Console.WriteLine(html);
    }
}

Input:

<p>The following example writes the number of <xref data-throw-if-not-resolved="true" uid="Microsoft.Office.InfoPath.Server.Administration.ExemptUserAgent"></xref> objects and lists them from the collection. References are required in the Visual Studio project to the <strong>Microsoft.Office.Server</strong>, <strong>Microsoft.Office.InfoPath.Server</strong>, and <strong>Microsoft.SharePoint</strong> assemblies.</p>
<p>
    <strong>Note</strong>: Browse for the <strong>Microsoft.Office.InfoPath.Server</strong> assembly at &lt;drive&gt;:\Program Files\Microsoft Office Servers\14.0\Bin. The <strong>Microsoft.Office.Server</strong> reference is listed as Microsoft Office Server component and the <strong>Microsoft.SharePoint</strong> reference is listed as Windows SharePoint Services on the .NET tab of the Add Reference dialog box.
</p>
<p>The following <strong>import</strong> statements are required for the</p>
<p>
    <xref data-throw-if-not-resolved="true" uid="Microsoft.Office.Server"></xref>, <xref data-throw-if-not-resolved="true" uid="Microsoft.Office.InfoPath.Server.Administration"></xref>, and <xref data-throw-if-not-resolved="true" uid="Microsoft.SharePoint.Administration"></xref> namespaces:
</p>
<pre><code>    Dim LocalFormsService As FormsService
    Dim LocalFarm As SPFarm
    Dim ExUserAgents As Integer
    Dim ExUserAgent As ExemptUserAgent
    Dim ExUserAgentsCollection As ExemptUserAgentCollection

    Try
        LocalFarm = SPFarm.Local
        LocalFormsService = LocalFarm.Services.GetValue(Of FormsService)(FormsService.ServiceName)
        ExUserAgents = LocalFormsService.ExemptUserAgents.Count()
        Console.WriteLine("Number of exempt user agents: " &amp;amp; ExUserAgents.ToString())
        ExUserAgentsCollection = LocalFormsService.&lt;span class="label"&gt;ExemptUserAgents&lt;/span&gt;
        For Each ExUserAgent In ExUserAgentsCollection
            Console.WriteLine(ExUserAgent.Name)
        Next
        Console.Write("Press Enter to Continue")
        Console.ReadLine()
    Catch ex As Exception
        Console.WriteLine("Error: " + ex.Message)
        Console.Write("Press Enter to Continue")
        Console.ReadLine()
    End Try</code></pre>
<p>The following <strong>using</strong> statements are required for the <xref data-throw-if-not-resolved="true" uid="Microsoft.Office.Server"></xref>, <xref data-throw-if-not-resolved="true" uid="Microsoft.Office.InfoPath.Server.Administration"></xref>, and <xref data-throw-if-not-resolved="true" uid="Microsoft.SharePoint.Administration"></xref> namespaces.</p>
<pre><code>    FormsService localFormsService;
    SPFarm localFarm = SPFarm.Local;
    Int16 exAgents;
    ExemptUserAgentCollection exUserAgentCollection;

    try
    {
        localFormsService = localFarm.Services.GetValue&amp;lt;FormsService&amp;gt;(FormsService.ServiceName);
        exAgents = (Int16)localFormsService.ExemptUserAgents.Count;
        Console.WriteLine("Number of exempt user agents: " + exAgents.ToString());
        exUserAgentCollection = localFormsService.&lt;span class="label"&gt;ExemptUserAgents&lt;/span&gt;;
        foreach(ExemptUserAgent exUserAgent in exUserAgentCollection)
        {
            Console.WriteLine(exUserAgent.Name);
        }
        Console.Write("Press Enter to Continue");
        Console.ReadLine();
    }
    catch (Exception ex)
    {
        Console.WriteLine("Error: " + ex.Message);
        Console.Write("Press Enter to Continue");
        Console.ReadLine();
    }</code></pre>

Output:

<p>The following example writes the number of <xref data-throw-if-not-resolved="true" uid="Microsoft.Office.InfoPath.Server.Administration.ExemptUserAgent"></xref> objects and lists them from the collection. References are required in the Visual Studio project to the <strong>Microsoft.Office.Server</strong>, <strong>Microsoft.Office.InfoPath.Server</strong>, and <strong>Microsoft.SharePoint</strong> assemblies.</p>
<p>
    <strong>Note</strong>: Browse for the <strong>Microsoft.Office.InfoPath.Server</strong> assembly at &lt;drive&gt;:\Program Files\Microsoft Office Servers\14.0\Bin. The <strong>Microsoft.Office.Server</strong> reference is listed as Microsoft Office Server component and the <strong>Microsoft.SharePoint</strong> reference is listed as Windows SharePoint Services on the .NET tab of the Add Reference dialog box.
</p>
<p>The following <strong>import</strong> statements are required for the</p>
<p>
    <xref data-throw-if-not-resolved="true" uid="Microsoft.Office.Server"></xref>, <xref data-throw-if-not-resolved="true" uid="Microsoft.Office.InfoPath.Server.Administration"></xref>, and <xref data-throw-if-not-resolved="true" uid="Microsoft.SharePoint.Administration"></xref> namespaces:
</p>
<pre><code>    Dim LocalFormsService As FormsService
    Dim LocalFarm As SPFarm
    Dim ExUserAgents As Integer
    Dim ExUserAgent As ExemptUserAgent
    Dim ExUserAgentsCollection As ExemptUserAgentCollection
<pre><code>Try
    LocalFarm = SPFarm.Local
    LocalFormsService = LocalFarm.Services.GetValue(Of FormsService)(FormsService.ServiceName)
    ExUserAgents = LocalFormsService.ExemptUserAgents.Count()
    Console.WriteLine(&quot;Number of exempt user agents: &quot; &amp;amp;amp; ExUserAgents.ToString())
    ExUserAgentsCollection = LocalFormsService.&amp;lt;span class=&quot;label&quot;&amp;gt;ExemptUserAgents&amp;lt;/span&amp;gt;
    For Each ExUserAgent In ExUserAgentsCollection
        Console.WriteLine(ExUserAgent.Name)
    Next
    Console.Write(&quot;Press Enter to Continue&quot;)
    Console.ReadLine()
Catch ex As Exception
    Console.WriteLine(&quot;Error: &quot; + ex.Message)
    Console.Write(&quot;Press Enter to Continue&quot;)
    Console.ReadLine()
End Try&lt;/code&gt;&lt;/pre&gt;
</code></pre>
<p>The following <strong>using</strong> statements are required for the <xref data-throw-if-not-resolved="true" uid="Microsoft.Office.Server"></xref>, <xref data-throw-if-not-resolved="true" uid="Microsoft.Office.InfoPath.Server.Administration"></xref>, and <xref data-throw-if-not-resolved="true" uid="Microsoft.SharePoint.Administration"></xref> namespaces.</p>
<pre><code>    FormsService localFormsService;
    SPFarm localFarm = SPFarm.Local;
    Int16 exAgents;
    ExemptUserAgentCollection exUserAgentCollection;
<pre><code>try
{
    localFormsService = localFarm.Services.GetValue&amp;amp;lt;FormsService&amp;amp;gt;(FormsService.ServiceName);
    exAgents = (Int16)localFormsService.ExemptUserAgents.Count;
    Console.WriteLine(&quot;Number of exempt user agents: &quot; + exAgents.ToString());
    exUserAgentCollection = localFormsService.&amp;lt;span class=&quot;label&quot;&amp;gt;ExemptUserAgents&amp;lt;/span&amp;gt;;
    foreach(ExemptUserAgent exUserAgent in exUserAgentCollection)
    {
        Console.WriteLine(exUserAgent.Name);
    }
    Console.Write(&quot;Press Enter to Continue&quot;);
    Console.ReadLine();
}
catch (Exception ex)
{
    Console.WriteLine(&quot;Error: &quot; + ex.Message);
    Console.Write(&quot;Press Enter to Continue&quot;);
    Console.ReadLine();
}&lt;/code&gt;&lt;/pre&gt;
</code></pre>
Originally created by @v-caxian on GitHub (Aug 31, 2020). ## Issue Description There is a wrong html encoding that causes the `</code></pre>` tag to be converted to `&lt;/code&gt;&lt;/pre&gt;` and it cannot be closed properly. ## Repro Steps ```cs using System; using Markdig; class Program { static void Main(string[] args) { var markdown = "<p>The following example writes the number of <xref data-throw-if-not-resolved=\"true\" uid=\"Microsoft.Office.InfoPath.Server.Administration.ExemptUserAgent\"></xref> objects and lists them from the collection. References are required in the Visual Studio project to the <strong>Microsoft.Office.Server</strong>, <strong>Microsoft.Office.InfoPath.Server</strong>, and <strong>Microsoft.SharePoint</strong> assemblies.</p>\r\n<p>\r\n <strong>Note</strong>: Browse for the <strong>Microsoft.Office.InfoPath.Server</strong> assembly at &lt;drive&gt;:\\Program Files\\Microsoft Office Servers\\14.0\\Bin. The <strong>Microsoft.Office.Server</strong> reference is listed as Microsoft Office Server component and the <strong>Microsoft.SharePoint</strong> reference is listed as Windows SharePoint Services on the .NET tab of the Add Reference dialog box.\r\n</p>\r\n<p>The following <strong>import</strong> statements are required for the</p>\r\n<p>\r\n <xref data-throw-if-not-resolved=\"true\" uid=\"Microsoft.Office.Server\"></xref>, <xref data-throw-if-not-resolved=\"true\" uid=\"Microsoft.Office.InfoPath.Server.Administration\"></xref>, and <xref data-throw-if-not-resolved=\"true\" uid=\"Microsoft.SharePoint.Administration\"></xref> namespaces:\r\n</p>\r\n<pre><code> Dim LocalFormsService As FormsService\r\n Dim LocalFarm As SPFarm\r\n Dim ExUserAgents As Integer\r\n Dim ExUserAgent As ExemptUserAgent\r\n Dim ExUserAgentsCollection As ExemptUserAgentCollection\r\n\r\n Try\r\n LocalFarm = SPFarm.Local\r\n LocalFormsService = LocalFarm.Services.GetValue(Of FormsService)(FormsService.ServiceName)\r\n ExUserAgents = LocalFormsService.ExemptUserAgents.Count()\r\n Console.WriteLine(\"Number of exempt user agents: \" &amp;amp; ExUserAgents.ToString())\r\n ExUserAgentsCollection = LocalFormsService.&lt;span class=\"label\"&gt;ExemptUserAgents&lt;/span&gt;\r\n For Each ExUserAgent In ExUserAgentsCollection\r\n Console.WriteLine(ExUserAgent.Name)\r\n Next\r\n Console.Write(\"Press Enter to Continue\")\r\n Console.ReadLine()\r\n Catch ex As Exception\r\n Console.WriteLine(\"Error: \" + ex.Message)\r\n Console.Write(\"Press Enter to Continue\")\r\n Console.ReadLine()\r\n End Try</code></pre>\r\n<p>The following <strong>using</strong> statements are required for the <xref data-throw-if-not-resolved=\"true\" uid=\"Microsoft.Office.Server\"></xref>, <xref data-throw-if-not-resolved=\"true\" uid=\"Microsoft.Office.InfoPath.Server.Administration\"></xref>, and <xref data-throw-if-not-resolved=\"true\" uid=\"Microsoft.SharePoint.Administration\"></xref> namespaces.</p>\r\n<pre><code> FormsService localFormsService;\r\n SPFarm localFarm = SPFarm.Local;\r\n Int16 exAgents;\r\n ExemptUserAgentCollection exUserAgentCollection;\r\n\r\n try\r\n {\r\n localFormsService = localFarm.Services.GetValue&amp;lt;FormsService&amp;gt;(FormsService.ServiceName);\r\n exAgents = (Int16)localFormsService.ExemptUserAgents.Count;\r\n Console.WriteLine(\"Number of exempt user agents: \" + exAgents.ToString());\r\n exUserAgentCollection = localFormsService.&lt;span class=\"label\"&gt;ExemptUserAgents&lt;/span&gt;;\r\n foreach(ExemptUserAgent exUserAgent in exUserAgentCollection)\r\n {\r\n Console.WriteLine(exUserAgent.Name);\r\n }\r\n Console.Write(\"Press Enter to Continue\");\r\n Console.ReadLine();\r\n }\r\n catch (Exception ex)\r\n {\r\n Console.WriteLine(\"Error: \" + ex.Message);\r\n Console.Write(\"Press Enter to Continue\");\r\n Console.ReadLine();\r\n }</code></pre>"; var html = Markdown.ToHtml(markdown); Console.WriteLine(html); } } ``` **Input:** ```md <p>The following example writes the number of <xref data-throw-if-not-resolved="true" uid="Microsoft.Office.InfoPath.Server.Administration.ExemptUserAgent"></xref> objects and lists them from the collection. References are required in the Visual Studio project to the <strong>Microsoft.Office.Server</strong>, <strong>Microsoft.Office.InfoPath.Server</strong>, and <strong>Microsoft.SharePoint</strong> assemblies.</p> <p> <strong>Note</strong>: Browse for the <strong>Microsoft.Office.InfoPath.Server</strong> assembly at &lt;drive&gt;:\Program Files\Microsoft Office Servers\14.0\Bin. The <strong>Microsoft.Office.Server</strong> reference is listed as Microsoft Office Server component and the <strong>Microsoft.SharePoint</strong> reference is listed as Windows SharePoint Services on the .NET tab of the Add Reference dialog box. </p> <p>The following <strong>import</strong> statements are required for the</p> <p> <xref data-throw-if-not-resolved="true" uid="Microsoft.Office.Server"></xref>, <xref data-throw-if-not-resolved="true" uid="Microsoft.Office.InfoPath.Server.Administration"></xref>, and <xref data-throw-if-not-resolved="true" uid="Microsoft.SharePoint.Administration"></xref> namespaces: </p> <pre><code> Dim LocalFormsService As FormsService Dim LocalFarm As SPFarm Dim ExUserAgents As Integer Dim ExUserAgent As ExemptUserAgent Dim ExUserAgentsCollection As ExemptUserAgentCollection Try LocalFarm = SPFarm.Local LocalFormsService = LocalFarm.Services.GetValue(Of FormsService)(FormsService.ServiceName) ExUserAgents = LocalFormsService.ExemptUserAgents.Count() Console.WriteLine("Number of exempt user agents: " &amp;amp; ExUserAgents.ToString()) ExUserAgentsCollection = LocalFormsService.&lt;span class="label"&gt;ExemptUserAgents&lt;/span&gt; For Each ExUserAgent In ExUserAgentsCollection Console.WriteLine(ExUserAgent.Name) Next Console.Write("Press Enter to Continue") Console.ReadLine() Catch ex As Exception Console.WriteLine("Error: " + ex.Message) Console.Write("Press Enter to Continue") Console.ReadLine() End Try</code></pre> <p>The following <strong>using</strong> statements are required for the <xref data-throw-if-not-resolved="true" uid="Microsoft.Office.Server"></xref>, <xref data-throw-if-not-resolved="true" uid="Microsoft.Office.InfoPath.Server.Administration"></xref>, and <xref data-throw-if-not-resolved="true" uid="Microsoft.SharePoint.Administration"></xref> namespaces.</p> <pre><code> FormsService localFormsService; SPFarm localFarm = SPFarm.Local; Int16 exAgents; ExemptUserAgentCollection exUserAgentCollection; try { localFormsService = localFarm.Services.GetValue&amp;lt;FormsService&amp;gt;(FormsService.ServiceName); exAgents = (Int16)localFormsService.ExemptUserAgents.Count; Console.WriteLine("Number of exempt user agents: " + exAgents.ToString()); exUserAgentCollection = localFormsService.&lt;span class="label"&gt;ExemptUserAgents&lt;/span&gt;; foreach(ExemptUserAgent exUserAgent in exUserAgentCollection) { Console.WriteLine(exUserAgent.Name); } Console.Write("Press Enter to Continue"); Console.ReadLine(); } catch (Exception ex) { Console.WriteLine("Error: " + ex.Message); Console.Write("Press Enter to Continue"); Console.ReadLine(); }</code></pre> ``` **Output:** ```Html <p>The following example writes the number of <xref data-throw-if-not-resolved="true" uid="Microsoft.Office.InfoPath.Server.Administration.ExemptUserAgent"></xref> objects and lists them from the collection. References are required in the Visual Studio project to the <strong>Microsoft.Office.Server</strong>, <strong>Microsoft.Office.InfoPath.Server</strong>, and <strong>Microsoft.SharePoint</strong> assemblies.</p> <p> <strong>Note</strong>: Browse for the <strong>Microsoft.Office.InfoPath.Server</strong> assembly at &lt;drive&gt;:\Program Files\Microsoft Office Servers\14.0\Bin. The <strong>Microsoft.Office.Server</strong> reference is listed as Microsoft Office Server component and the <strong>Microsoft.SharePoint</strong> reference is listed as Windows SharePoint Services on the .NET tab of the Add Reference dialog box. </p> <p>The following <strong>import</strong> statements are required for the</p> <p> <xref data-throw-if-not-resolved="true" uid="Microsoft.Office.Server"></xref>, <xref data-throw-if-not-resolved="true" uid="Microsoft.Office.InfoPath.Server.Administration"></xref>, and <xref data-throw-if-not-resolved="true" uid="Microsoft.SharePoint.Administration"></xref> namespaces: </p> <pre><code> Dim LocalFormsService As FormsService Dim LocalFarm As SPFarm Dim ExUserAgents As Integer Dim ExUserAgent As ExemptUserAgent Dim ExUserAgentsCollection As ExemptUserAgentCollection <pre><code>Try LocalFarm = SPFarm.Local LocalFormsService = LocalFarm.Services.GetValue(Of FormsService)(FormsService.ServiceName) ExUserAgents = LocalFormsService.ExemptUserAgents.Count() Console.WriteLine(&quot;Number of exempt user agents: &quot; &amp;amp;amp; ExUserAgents.ToString()) ExUserAgentsCollection = LocalFormsService.&amp;lt;span class=&quot;label&quot;&amp;gt;ExemptUserAgents&amp;lt;/span&amp;gt; For Each ExUserAgent In ExUserAgentsCollection Console.WriteLine(ExUserAgent.Name) Next Console.Write(&quot;Press Enter to Continue&quot;) Console.ReadLine() Catch ex As Exception Console.WriteLine(&quot;Error: &quot; + ex.Message) Console.Write(&quot;Press Enter to Continue&quot;) Console.ReadLine() End Try&lt;/code&gt;&lt;/pre&gt; </code></pre> <p>The following <strong>using</strong> statements are required for the <xref data-throw-if-not-resolved="true" uid="Microsoft.Office.Server"></xref>, <xref data-throw-if-not-resolved="true" uid="Microsoft.Office.InfoPath.Server.Administration"></xref>, and <xref data-throw-if-not-resolved="true" uid="Microsoft.SharePoint.Administration"></xref> namespaces.</p> <pre><code> FormsService localFormsService; SPFarm localFarm = SPFarm.Local; Int16 exAgents; ExemptUserAgentCollection exUserAgentCollection; <pre><code>try { localFormsService = localFarm.Services.GetValue&amp;amp;lt;FormsService&amp;amp;gt;(FormsService.ServiceName); exAgents = (Int16)localFormsService.ExemptUserAgents.Count; Console.WriteLine(&quot;Number of exempt user agents: &quot; + exAgents.ToString()); exUserAgentCollection = localFormsService.&amp;lt;span class=&quot;label&quot;&amp;gt;ExemptUserAgents&amp;lt;/span&amp;gt;; foreach(ExemptUserAgent exUserAgent in exUserAgentCollection) { Console.WriteLine(exUserAgent.Name); } Console.Write(&quot;Press Enter to Continue&quot;); Console.ReadLine(); } catch (Exception ex) { Console.WriteLine(&quot;Error: &quot; + ex.Message); Console.Write(&quot;Press Enter to Continue&quot;); Console.ReadLine(); }&lt;/code&gt;&lt;/pre&gt; </code></pre> ```
claunia added the invalid label 2026-01-29 14:35:43 +00:00
Author
Owner

@MihaZupan commented on GitHub (Aug 31, 2020):

Can you please provide a minimal example we can look at?

@MihaZupan commented on GitHub (Aug 31, 2020): Can you please provide a minimal example we can look at?
Author
Owner

@xoofx commented on GitHub (Aug 31, 2020):

The empty lines in the <code><pre> is breaking the markdown HTML input. This is valid per CommonMark spec.
Use instead code fence with backsticks instead, or don't use a Markdown converter if your input is solely HTML.

@xoofx commented on GitHub (Aug 31, 2020): The empty lines in the `<code><pre>` is breaking the markdown HTML input. This is valid per CommonMark spec. Use instead code fence with backsticks instead, or don't use a Markdown converter if your input is solely HTML.
Author
Owner

@xoofx commented on GitHub (Aug 31, 2020):

Errata, the issue is that you are missing a new line before the <pre><code> in order for the parser to allow blank lines, otherwise the <pre><code> gets parsed with the previous HTML block (e.g <p>)

@xoofx commented on GitHub (Aug 31, 2020): Errata, the issue is that you are missing a new line before the `<pre><code>` in order for the parser to allow blank lines, otherwise the `<pre><code>` gets parsed with the previous HTML block (e.g `<p>`)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/markdig#397