From bc65c490e7e8c7049264179ddea41b80db409cac Mon Sep 17 00:00:00 2001 From: LiAuTraver <63725840+LiAuTraver@users.noreply.github.com> Date: Tue, 11 Jun 2024 16:14:45 +0000 Subject: [PATCH 1/2] Fix a Renderer problem related to markdown table --- .../Renderers/ToolkitDocumentationRenderer.xaml.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CommunityToolkit.App.Shared/Renderers/ToolkitDocumentationRenderer.xaml.cs b/CommunityToolkit.App.Shared/Renderers/ToolkitDocumentationRenderer.xaml.cs index 659f0a0..76ba252 100644 --- a/CommunityToolkit.App.Shared/Renderers/ToolkitDocumentationRenderer.xaml.cs +++ b/CommunityToolkit.App.Shared/Renderers/ToolkitDocumentationRenderer.xaml.cs @@ -154,7 +154,7 @@ private static async Task GetDocumentationFileContents(ToolkitFrontMatte // TODO: https://github.com/CommunityToolkit/Labs-Windows/issues/142 // MSBuild uses wildcard to find the files, and the wildcards decide where they end up // Single experiments use relative paths, the allExperiment head uses absolute paths that grab from all experiments - // The wildcard captures decide the paths. This discrepency is accounted for manually. + // The wildcard captures decide the paths. This discrepancy is accounted for manually. // Logic here is the exact same that MSBuild uses to find and include the files we need. var assemblyName = typeof(ToolkitSampleRenderer).Assembly.GetName().Name; if (string.IsNullOrWhiteSpace(assemblyName)) @@ -178,7 +178,7 @@ private static async Task GetDocumentationFileContents(ToolkitFrontMatte var textContents = await FileIO.ReadTextAsync(file); // Remove YAML - need to use array overload as single string not supported on .NET Standard 2.0 - var blocks = textContents.Split(new[] { "---" }, StringSplitOptions.RemoveEmptyEntries); + var blocks = textContents.Split(new[] { "---" }, 2, StringSplitOptions.RemoveEmptyEntries); return blocks.LastOrDefault() ?? "Couldn't find content after YAML Front Matter removal."; } From 1bb58d4acbeaa7cae8c720b3bb74e5e8cabf0efa Mon Sep 17 00:00:00 2001 From: LiAuTraver <63725840+LiAuTraver@users.noreply.github.com> Date: Tue, 11 Jun 2024 17:29:51 +0000 Subject: [PATCH 2/2] Fix a Renderer problem related to markdown table and replace
with whitespace --- .../Renderers/ToolkitDocumentationRenderer.xaml.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CommunityToolkit.App.Shared/Renderers/ToolkitDocumentationRenderer.xaml.cs b/CommunityToolkit.App.Shared/Renderers/ToolkitDocumentationRenderer.xaml.cs index 76ba252..ced2784 100644 --- a/CommunityToolkit.App.Shared/Renderers/ToolkitDocumentationRenderer.xaml.cs +++ b/CommunityToolkit.App.Shared/Renderers/ToolkitDocumentationRenderer.xaml.cs @@ -180,7 +180,7 @@ private static async Task GetDocumentationFileContents(ToolkitFrontMatte // Remove YAML - need to use array overload as single string not supported on .NET Standard 2.0 var blocks = textContents.Split(new[] { "---" }, 2, StringSplitOptions.RemoveEmptyEntries); - return blocks.LastOrDefault() ?? "Couldn't find content after YAML Front Matter removal."; + return blocks.LastOrDefault()?.Replace("
", " ") ?? "Couldn't find content after YAML Front Matter removal."; } catch (Exception e) {