From 3635a0d0791fd3017e0c1f45bf9fc9e77b1cfae7 Mon Sep 17 00:00:00 2001 From: Laurent Aerens Date: Thu, 30 May 2024 13:53:21 +0200 Subject: [PATCH] fix: Add HTML entity replacements for tab and space characters --- csharp/DiffMatchPatch.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/csharp/DiffMatchPatch.cs b/csharp/DiffMatchPatch.cs index 6e196418..67247b31 100644 --- a/csharp/DiffMatchPatch.cs +++ b/csharp/DiffMatchPatch.cs @@ -1338,7 +1338,7 @@ public string diff_prettyHtml(List diffs) { StringBuilder html = new StringBuilder(); foreach (Diff aDiff in diffs) { string text = aDiff.text.Replace("&", "&").Replace("<", "<") - .Replace(">", ">").Replace("\n", "¶
"); + .Replace(">", ">").Replace("\n", "¶
").Replace("\t", " ").Replace(" ", " ");; switch (aDiff.operation) { case Operation.INSERT: html.Append("").Append(text)