/// <summary> /// Takes a diff array and returns a HTML sequence. /// </summary> /// <returns>Html page as string or string.Empty if the Diff(text1, text2) was not run previously</returns> public string DiffAsHtml() { if (diffs == null) { return(string.Empty); } return(diffMatchPatch.diff_prettyHtml(diffs)); }
private static string GetPrettyHtmlDiff(string text1, string text2) { if (text1 == null) { text1 = ""; } if (text2 == null) { text2 = ""; } var diffs = Dmp.diff_main(text1, text2); Dmp.diff_cleanupSemantic(diffs); return(Dmp.diff_prettyHtml(diffs)); }