You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the file ExtensionMethods.cs there are two different implementations of ToJson. We are currently using the Newtonsoft version, for which we can optionally use htmlEscape. However, in MiniProfiler release 4.5.4, the STJSON version is used, in which the htmlEscape parameter is not used.
Was it intentional not to use the htmlEscape option in STJSON?
And is it possible to create a version in which newtonsoft/htmlEscape can be used?
Newtonsoft:
/// <summary>
/// Renders the parameter <see cref="MiniProfiler"/> to JSON.
/// </summary>
/// <param name="profiler">The <see cref="MiniProfiler"/> to serialize.</param>
/// <param name="htmlEscape">Whether to HTML escape the output.</param>
[return: NotNullIfNotNull(nameof(profiler))]
public static string? ToJson(this MiniProfiler? profiler, bool htmlEscape = false) =>
profiler != default
? (htmlEscape ? JsonConvert.SerializeObject(profiler, htmlEscapeSettings) : JsonConvert.SerializeObject(profiler, defaultSettings))
: null;
STJSON:
/// <summary>
/// Renders the parameter <see cref="MiniProfiler"/> to JSON.
/// </summary>
/// <param name="profiler">The <see cref="MiniProfiler"/> to serialize.</param>
/// <param name="htmlEscape">Whether to HTML escape the output.</param>
[return: NotNullIfNotNull(nameof(profiler))]
[SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "Compatibility across versions")]
public static string? ToJson(this MiniProfiler? profiler, bool htmlEscape = false) =>
profiler != default
? JsonSerializer.Serialize(profiler, defaultSettings)
: null;
The text was updated successfully, but these errors were encountered:
In the file ExtensionMethods.cs there are two different implementations of ToJson. We are currently using the Newtonsoft version, for which we can optionally use htmlEscape. However, in MiniProfiler release 4.5.4, the STJSON version is used, in which the htmlEscape parameter is not used.
Was it intentional not to use the htmlEscape option in STJSON?
And is it possible to create a version in which newtonsoft/htmlEscape can be used?
Newtonsoft:
STJSON:
The text was updated successfully, but these errors were encountered: