fix whitespace in HtmlBlock within ListItemBlock

This commit is contained in:
Ruud Poutsma
2020-10-24 15:53:34 +02:00
parent e6b591c035
commit bb1da73da2
2 changed files with 7 additions and 4 deletions

View File

@@ -876,10 +876,13 @@ namespace Markdig.Parsers
{
if (!result.IsDiscard())
{
bool isParagraph = block is ParagraphBlock;
if (TrackTrivia && isParagraph)
if (TrackTrivia)
{
UnwindAllIndents();
if (block is ParagraphBlock ||
block is HtmlBlock)
{
UnwindAllIndents();
}
}
leaf.AppendLine(ref Line, Column, LineIndex, CurrentLineStartPosition, TrackTrivia);
}

View File

@@ -277,7 +277,7 @@ namespace Markdig.Parsers
Type = type,
// By default, setup to the end of line
Span = new SourceSpan(startPosition, startPosition + state.Line.End),
BeforeWhitespace = state.PopBeforeWhitespace(startPosition - 1),
//BeforeWhitespace = state.PopBeforeWhitespace(startPosition - 1),
LinesBefore = state.UseLinesBefore(),
Newline = state.Line.Newline,
});