Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions Microsoft.Toolkit.Parsers/Markdown/Inlines/LinkAnchorInline.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// See the LICENSE file in the project root for more information.

using System.Collections.Generic;
using System.Xml;
using System.Xml.Linq;
using Microsoft.Toolkit.Parsers.Markdown.Helpers;

namespace Microsoft.Toolkit.Parsers.Markdown.Inlines
Expand Down Expand Up @@ -85,10 +85,12 @@ internal static InlineParseResult Parse(string markdown, int start, int maxEnd)

try
{
var xml = new XmlDocument();
xml.LoadXml(contents);
var attr = xml.DocumentElement.Attributes.GetNamedItem("name");
link = attr.Value;
var xml = XElement.Parse(contents);
var attr = xml.Attribute("name");
if (attr != null)
{
link = attr.Value;
}
}
catch
{
Expand Down
4 changes: 0 additions & 4 deletions Microsoft.Toolkit.Parsers/Microsoft.Toolkit.Parsers.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@
<DebugType>Full</DebugType>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="10.0.3" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Microsoft.Toolkit\Microsoft.Toolkit.csproj" />
</ItemGroup>
Expand Down