Skip to content

Commit bc976cb

Browse files
Fix a Renderer problem related to markdown table (#193)
* Fix a Renderer problem related to markdown table * Fix a Renderer problem related to markdown table and replace <br> with whitespace --------- Co-authored-by: Arlo <arlo.godfrey@outlook.com>
1 parent d9bfddf commit bc976cb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

CommunityToolkit.App.Shared/Renderers/ToolkitDocumentationRenderer.xaml.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ private static async Task<string> GetDocumentationFileContents(ToolkitFrontMatte
154154
// TODO: https://github.com/CommunityToolkit/Labs-Windows/issues/142
155155
// MSBuild uses wildcard to find the files, and the wildcards decide where they end up
156156
// Single experiments use relative paths, the allExperiment head uses absolute paths that grab from all experiments
157-
// The wildcard captures decide the paths. This discrepency is accounted for manually.
157+
// The wildcard captures decide the paths. This discrepancy is accounted for manually.
158158
// Logic here is the exact same that MSBuild uses to find and include the files we need.
159159
var assemblyName = typeof(ToolkitSampleRenderer).Assembly.GetName().Name;
160160
if (string.IsNullOrWhiteSpace(assemblyName))
@@ -178,9 +178,9 @@ private static async Task<string> GetDocumentationFileContents(ToolkitFrontMatte
178178
var textContents = await FileIO.ReadTextAsync(file);
179179

180180
// Remove YAML - need to use array overload as single string not supported on .NET Standard 2.0
181-
var blocks = textContents.Split(new[] { "---" }, StringSplitOptions.RemoveEmptyEntries);
181+
var blocks = textContents.Split(new[] { "---" }, 2, StringSplitOptions.RemoveEmptyEntries);
182182

183-
return blocks.LastOrDefault() ?? "Couldn't find content after YAML Front Matter removal.";
183+
return blocks.LastOrDefault()?.Replace("<br>", " ") ?? "Couldn't find content after YAML Front Matter removal.";
184184
}
185185
catch (Exception e)
186186
{

0 commit comments

Comments
 (0)