typo: dicard -> discard

This commit is contained in:
Nick Schonning
2019-04-15 01:40:58 -04:00
parent 01d8842ac1
commit 01c8aedced

View File

@@ -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 Markdig.Helpers;
using Markdig.Syntax;
@@ -116,11 +116,11 @@ namespace Markdig.Parsers
if (headingChar != 0)
{
// If we matched a LinkReferenceDefinition before matching the heading, and the remaining
// If we matched a LinkReferenceDefinition before matching the heading, and the remaining
// lines are empty, we can early exit and remove the paragraph
if (!(TryMatchLinkReferenceDefinition(ref paragraph.Lines, state) && paragraph.Lines.Count == 0))
{
// We dicard the paragraph that will be transformed to a heading
{
// We discard the paragraph that will be transformed to a heading
state.Discard(paragraph);
var level = headingChar == '=' ? 1 : 2;
@@ -135,8 +135,8 @@ namespace Markdig.Parsers
heading.Lines.Trim();
// Remove the paragraph as a pending block
state.NewBlocks.Push(heading);
state.NewBlocks.Push(heading);
return BlockState.BreakDiscard;
}
}
@@ -155,14 +155,14 @@ namespace Markdig.Parsers
// If we have found a LinkReferenceDefinition, we can discard the previous paragraph
var iterator = lines.ToCharIterator();
if (LinkReferenceDefinition.TryParse(ref iterator, out LinkReferenceDefinition linkReferenceDefinition))
{
{
state.Document.SetLinkReferenceDefinition(linkReferenceDefinition.Label, linkReferenceDefinition);
atLeastOneFound = true;
// Correct the locations of each field
linkReferenceDefinition.Line = lines.Lines[0].Line;
int startPosition = lines.Lines[0].Slice.Start;
linkReferenceDefinition.Line = lines.Lines[0].Line;
int startPosition = lines.Lines[0].Slice.Start;
linkReferenceDefinition.Span = linkReferenceDefinition.Span .MoveForward(startPosition);
linkReferenceDefinition.LabelSpan = linkReferenceDefinition.LabelSpan .MoveForward(startPosition);
linkReferenceDefinition.UrlSpan = linkReferenceDefinition.UrlSpan .MoveForward(startPosition);