Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion cpp/diff_match_patch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1276,7 +1276,8 @@ QString diff_match_patch::diff_prettyHtml(const QList<Diff> &diffs) {
foreach(Diff aDiff, diffs) {
text = aDiff.text;
text.replace("&", "&amp;").replace("<", "&lt;")
.replace(">", "&gt;").replace("\n", "&para;<br>");
.replace(">", "&gt;").replace("\n", "&para;<br>")
.replace("\t", "&emsp;").replace(" ", "&nbsp;");
switch (aDiff.operation) {
case INSERT:
html += QString("<ins style=\"background:#e6ffe6;\">") + text
Expand Down
2 changes: 1 addition & 1 deletion csharp/DiffMatchPatch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1338,7 +1338,7 @@ public string diff_prettyHtml(List<Diff> diffs) {
StringBuilder html = new StringBuilder();
foreach (Diff aDiff in diffs) {
string text = aDiff.text.Replace("&", "&amp;").Replace("<", "&lt;")
.Replace(">", "&gt;").Replace("\n", "&para;<br>");
.Replace(">", "&gt;").Replace("\n", "&para;<br>").Replace("\t", "&emsp;").Replace(" ", "&nbsp;");;
switch (aDiff.operation) {
case Operation.INSERT:
html.Append("<ins style=\"background:#e6ffe6;\">").Append(text)
Expand Down
4 changes: 3 additions & 1 deletion dart/DMPClass.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1256,7 +1256,9 @@ class DiffMatchPatch {
.replaceAll('&', '&amp;')
.replaceAll('<', '&lt;')
.replaceAll('>', '&gt;')
.replaceAll('\n', '&para;<br>');
.replaceAll('\n', '&para;<br>')
.replaceAll('\t', '&emsp;')
.replaceAll(' ', '&nbsp;');
switch (aDiff.operation) {
case Operation.insert:
html.write('<ins style="background:#e6ffe6;">');
Expand Down
3 changes: 2 additions & 1 deletion java/src/name/fraser/neil/plaintext/diff_match_patch.java
Original file line number Diff line number Diff line change
Expand Up @@ -1382,7 +1382,8 @@ public String diff_prettyHtml(List<Diff> diffs) {
StringBuilder html = new StringBuilder();
for (Diff aDiff : diffs) {
String text = aDiff.text.replace("&", "&amp;").replace("<", "&lt;")
.replace(">", "&gt;").replace("\n", "&para;<br>");
.replace(">", "&gt;").replace("\n", "&para;<br>")
.replace("\t", "&emsp;").replace(" ", "&nbsp;");
switch (aDiff.operation) {
case INSERT:
html.append("<ins style=\"background:#e6ffe6;\">").append(text)
Expand Down
2 changes: 1 addition & 1 deletion javascript/diff_match_patch.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading