private static string GetBody(Base o) { var diffMatchPatch = new DiffMatchPatch.DiffMatchPatch(); var differents = diffMatchPatch.DiffMain(o.Changes.Body.From, o.Issue.Body); diffMatchPatch.DiffCleanupSemantic(differents); //diffMatchPatch.DiffCleanupEfficiency(differents); return(diffMatchPatch.DiffEmbedBody(differents)); //return "```diff\n" + diffMatchPatch.DiffEmbedBody(differents) + "```"; /* var strBuilder = new StringBuilder(); * if (differents.Any(d => d.operation == DiffMatchPatch.Operation.INSERT)) * { * strBuilder.AppendLine("Added:"); * foreach (var diff in differents.Where(d => d.operation == DiffMatchPatch.Operation.INSERT).Select(d => d.text)) * { * strBuilder.AppendLine(diff); * } * } * * if (differents.Any(d => d.operation == DiffMatchPatch.Operation.DELETE)) * { * if (strBuilder.Length > 0) * strBuilder.AppendLine(); * strBuilder.AppendLine("Removed:"); * foreach (var diff in differents.Where(d => d.operation == DiffMatchPatch.Operation.DELETE).Select(d => d.text)) * { * strBuilder.AppendLine(diff); * } * } * * return strBuilder.ToString();*/ }