Skip to content

Commit

Permalink
Decode wiki route
Browse files Browse the repository at this point in the history
  • Loading branch information
WilStead committed Feb 21, 2024
1 parent 440ee5a commit e8c52b9
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: publish
env:
VERSION: '0.7.7-preview'
VERSION: '0.7.8-preview'
PRERELEASE: true
on:
push:
Expand Down
4 changes: 4 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 0.7.8-preview
### Fixed
- Decode wiki route

## 0.7.5-7-preview
### Updated
- Update dependencies
Expand Down
2 changes: 1 addition & 1 deletion src/Client/Tavenem.Wiki.Blazor.Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
<PackageReference Include="Microsoft.AspNetCore.WebUtilities" Version="8.0.2" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.0" />
<PackageReference Include="Tavenem.Blazor.Framework" Version="2.20.6" />
<PackageReference Include="Tavenem.Wiki" Version="0.24.3-preview" />
<PackageReference Include="Tavenem.Wiki" Version="0.24.4-preview" />
</ItemGroup>

<PropertyGroup>
Expand Down
9 changes: 6 additions & 3 deletions src/Client/Wiki.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using Microsoft.AspNetCore.Components.Routing;
using Microsoft.JSInterop;
using System.Text;
using System.Web;
using Tavenem.Blazor.Framework;
using Tavenem.Wiki.Blazor.Client.Shared;

Expand Down Expand Up @@ -420,7 +421,7 @@ protected override async Task RefreshAsync()
{
if (string.IsNullOrEmpty(input))
{
return Enumerable.Empty<KeyValuePair<string, object>>();
return [];
}

var suggestions = await FetchDataAsync(
Expand All @@ -431,7 +432,7 @@ protected override async Task RefreshAsync()
user,
input));
return suggestions?.Select(x => new KeyValuePair<string, object>(x, x))
?? Enumerable.Empty<KeyValuePair<string, object>>();
?? [];
}

private async Task GetWikiItemAsync()
Expand Down Expand Up @@ -682,9 +683,11 @@ private void SetRoute()
index = Route.IndexOf('#');
if (index != -1)
{
Fragment = Route[(index + 1)..];
Fragment = HttpUtility.UrlDecode(Route[(index + 1)..]);
Route = Route[..index];
}

Route = HttpUtility.UrlDecode(Route);
}
}

Expand Down

0 comments on commit e8c52b9

Please sign in to comment.