mirror of
https://github.com/xoofx/markdig.git
synced 2026-02-10 14:00:05 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
98c687b4ed | ||
|
|
8e4a732efe |
@@ -8,6 +8,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using Markdig.Extensions.JiraLinks;
|
||||
using Markdig.Renderers.Roundtrip;
|
||||
using Markdig.Syntax;
|
||||
using NUnit.Framework;
|
||||
|
||||
@@ -67,6 +68,15 @@ namespace Markdig.Tests
|
||||
TestDescendantsOrder.TestSchemas(specsSyntaxTrees);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ParseEmptyDocumentWithTrackTriviaEnabled()
|
||||
{
|
||||
var document = Markdown.Parse("", trackTrivia: true);
|
||||
using var sw = new StringWriter();
|
||||
new RoundtripRenderer(sw).Render(document);
|
||||
Assert.AreEqual("", sw.ToString());
|
||||
}
|
||||
|
||||
public static void TestSpec(string inputText, string expectedOutputText, string extensions = null, bool plainText = false, string context = null)
|
||||
{
|
||||
context ??= string.Empty;
|
||||
|
||||
@@ -65,7 +65,11 @@ namespace Markdig.Parsers
|
||||
var noBlocksFoundBlock = new EmptyBlock(null);
|
||||
List<StringSlice> linesBefore = blockProcessor.UseLinesBefore();
|
||||
noBlocksFoundBlock.LinesAfter = new List<StringSlice>();
|
||||
noBlocksFoundBlock.LinesAfter.AddRange(linesBefore);
|
||||
if (linesBefore != null)
|
||||
{
|
||||
noBlocksFoundBlock.LinesAfter.AddRange(linesBefore);
|
||||
}
|
||||
|
||||
document.Add(noBlocksFoundBlock);
|
||||
}
|
||||
else if (lastBlock != null && blockProcessor.LinesBefore != null)
|
||||
|
||||
Reference in New Issue
Block a user