diff --git a/Havit.Blazor.Components.Web.Bootstrap/Navigation/HxSidebarItem.razor.cs b/Havit.Blazor.Components.Web.Bootstrap/Navigation/HxSidebarItem.razor.cs index 9835cd9e..397cac5e 100644 --- a/Havit.Blazor.Components.Web.Bootstrap/Navigation/HxSidebarItem.razor.cs +++ b/Havit.Blazor.Components.Web.Bootstrap/Navigation/HxSidebarItem.razor.cs @@ -239,8 +239,8 @@ private static bool IsStrictlyPrefixWithSeparator(string value, string prefix) // Example: "/abc" is treated as a prefix of "/abc/def" but not "/abcdef" // Example: "/abc/" is treated as a prefix of "/abc/def" but not "/abcdef" prefixLength == 0 - || !char.IsLetterOrDigit(prefix[prefixLength - 1]) - || !char.IsLetterOrDigit(value[prefixLength]) + || !IsUnreservedCharacter(prefix[prefixLength - 1]) + || !IsUnreservedCharacter(value[prefixLength]) ); } else @@ -248,5 +248,18 @@ private static bool IsStrictlyPrefixWithSeparator(string value, string prefix) return false; } } + + private static bool IsUnreservedCharacter(char c) + { + // Checks whether it is an unreserved character according to + // https://datatracker.ietf.org/doc/html/rfc3986#section-2.3 + // Those are characters that are allowed in a URI but do not have a reserved + // purpose (e.g. they do not separate the components of the URI) + return char.IsLetterOrDigit(c) || + c == '-' || + c == '.' || + c == '_' || + c == '~'; + } #endregion } diff --git a/Havit.Blazor.Documentation/Shared/Navbar.razor b/Havit.Blazor.Documentation/Shared/Navbar.razor index 3bae4438..4a77d193 100644 --- a/Havit.Blazor.Documentation/Shared/Navbar.razor +++ b/Havit.Blazor.Documentation/Shared/Navbar.razor @@ -7,19 +7,19 @@ - + Introduction - + Documentation - + Blocks - + Showcase - + Premium diff --git a/Havit.Blazor.Documentation/Shared/Sidebar.razor b/Havit.Blazor.Documentation/Shared/Sidebar.razor index cd98df8a..b8f9a637 100644 --- a/Havit.Blazor.Documentation/Shared/Sidebar.razor +++ b/Havit.Blazor.Documentation/Shared/Sidebar.razor @@ -13,8 +13,8 @@ - - + +
Blocks 🔥
Premium