Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a Renderer problem related to markdown table #193

Merged
merged 4 commits into from
Jul 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ private static async Task<string> 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))
Expand All @@ -178,9 +178,9 @@ private static async Task<string> 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.";
return blocks.LastOrDefault()?.Replace("<br>", " ") ?? "Couldn't find content after YAML Front Matter removal.";
}
catch (Exception e)
{
Expand Down
Loading