Enable nullable on AutolinkInline

This commit is contained in:
Jason Nelson
2021-03-12 11:29:53 -08:00
parent 780e16a9c9
commit 8db238797b
2 changed files with 7 additions and 5 deletions

View File

@@ -35,10 +35,9 @@ namespace Markdig.Parsers.Inlines
int column;
if (LinkHelper.TryParseAutolink(ref slice, out string? link, out bool isEmail))
{
processor.Inline = new AutolinkInline()
processor.Inline = new AutolinkInline(url: link)
{
IsEmail = isEmail,
Url = link,
Span = new SourceSpan(processor.GetSourcePosition(saved.Start, out line, out column), processor.GetSourcePosition(slice.Start - 1)),
Line = line,
Column = column

View File

@@ -2,8 +2,6 @@
// This file is licensed under the BSD-Clause 2 license.
// See the license.txt file in the project root for more information.
#nullable disable
using System.Diagnostics;
namespace Markdig.Syntax.Inlines
@@ -13,8 +11,13 @@ namespace Markdig.Syntax.Inlines
/// </summary>
/// <seealso cref="LeafInline" />
[DebuggerDisplay("<{Url}>")]
public class AutolinkInline : LeafInline
public sealed class AutolinkInline : LeafInline
{
public AutolinkInline(string url)
{
Url = url;
}
/// <summary>
/// Gets or sets a value indicating whether this instance is an email link.
/// </summary>