Skip to content

Commit

Permalink
Html renderer fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Aragas committed Apr 7, 2024
1 parent ba28804 commit ee1d4d3
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/BUTR.CrashReport.Renderer.Html/CrashReportHtml.Html.cs
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ private static string ContainerCodeNew(string id, string name, string content, b

private static string Container(string id, string name, string content, bool hide = false) => $"""
<div class='root-container' {(hide ? "style='display: none;'" : string.Empty)}>
<h2><a href='javascript:;' class='headers' onclick='showHideById(this, "{id}")'>+ {name}</a></h2>
<h2><a href='javascript:;' class='headers' onclick='showHideById(this, '{id}')'>+ {name}</a></h2>
<div id='{id}' class='headers-container'>
{content}
</div>
Expand All @@ -308,7 +308,7 @@ private static string Container(string id, string name, string content, bool hid

private static string ContainerCode(string id, string name, string content, bool hide = false) => $"""
<div>
<a href="javascript:;" class="headers" onclick="showHideById(this, "{id}")">+ {name}</a>
<a href="javascript:;" class="headers" onclick="showHideById(this, '{id}')">+ {name}</a>
<div id="{id}" class="headers-container" style="display: none;">
<pre>
{content}
Expand Down
4 changes: 2 additions & 2 deletions src/BUTR.CrashReport.Renderer.Html/CrashReportHtml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -460,13 +460,13 @@ void AppendAdditionalAssemblies(ModuleModel module)
.AppendIf(hasDependencies, "</ul>")
.Append("Capabilities:").Append("</br>")
.Append("<ul>")
.Append((StringBuilder sb) =>
.AppendSb(sb =>
{
if (module.Capabilities.Count == 0)
sb.Append("<li>").Append("None").Append("</li>");
foreach (var capability in module.Capabilities)
sb.Append("<li>").Append(capability).Append("</li>");
sb.Append("<li>").Append(capability.Name).Append("</li>");
return sb;
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Collections.Generic;
using System.Linq;

namespace BUTR.CrashReport.Renderer.Html;
namespace BUTR.CrashReport.Renderer.Html.Extensions;

internal static class EnumExtensions
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using System.Linq;
using System.Text;

namespace BUTR.CrashReport.Renderer.Html;
namespace BUTR.CrashReport.Renderer.Html.Extensions;

internal static class StringBuilderExtensions
{
Expand Down Expand Up @@ -43,4 +43,6 @@ public static StringBuilder AppendJoinIf(this StringBuilder builder, bool condit
public static StringBuilder AppendLineIf(this StringBuilder builder, bool condition, string value) => condition ? builder.AppendLine(value) : builder;

public static StringBuilder AppendIf(this StringBuilder builder, bool condition, Func<StringBuilder, StringBuilder> lambda) => condition ? lambda(builder) : builder;

public static StringBuilder AppendSb(this StringBuilder builder, Func<StringBuilder, StringBuilder> lambda) => lambda(builder);
}

0 comments on commit ee1d4d3

Please sign in to comment.