Skip to content

Commit

Permalink
link anchor failed
Browse files Browse the repository at this point in the history
  • Loading branch information
whistyun committed Apr 16, 2023
1 parent 88426f9 commit 9c2f522
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
<PackageTargetFrameworks>net45;netcoreapp3.0;net6.0-windows</PackageTargetFrameworks>
<SampleTargetFrameworks>netcoreapp3.0;net461;net6.0-windows</SampleTargetFrameworks>
<TestTargetFrameworks>netcoreapp3.1;net461;net6.0-windows</TestTargetFrameworks>
<PackageVersion>1.18.0</PackageVersion>
<PackageVersion>1.18.1</PackageVersion>
</PropertyGroup>
</Project>
8 changes: 8 additions & 0 deletions MdXaml.Html/Core/Parsers/TypicalParseInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using System.Reflection;
using System.Windows;
using System.Windows.Documents;
using static System.Windows.Forms.VisualStyles.VisualStyleElement;

namespace MdXaml.Html.Core.Parsers
{
Expand Down Expand Up @@ -103,6 +104,13 @@ public bool TryReplace(HtmlNode node, ReplaceManager manager, out IEnumerable<Te
default:
throw new InvalidOperationException();
}

// for href anchor
if (node.Attributes["id"]?.Value is string idval
&& generated.FirstOrDefault() is DependencyObject tag)
{
tag.SetValue(DocumentAnchor.HyperlinkAnchorProperty, idval);
}
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion MdXaml.Plugins/SyntaxManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class SyntaxManager
EnableTableBlock = true,
EnableRuleExt = false,
EnableTextAlignment = false,
EnableStrikethrough = false,
EnableStrikethrough = true,
EnableListMarkerExt = false,
EnableTextileInline = false,
};
Expand Down

0 comments on commit 9c2f522

Please sign in to comment.