using Newtonsoft.Json.Linq;
public static class ClipboardFusionHelper
{
public static string ProcessText(string text)
{
string formatted;
if (TryFormatJson(text, out formatted))
return formatted;
return text;
}
private static bool TryFormatJson(string text, out string res)
{
try
{
res = JToken.Parse(text).ToString();
return true;
}
catch
{
res = text;
return false;
}
}
}