MCPcopy Create free account
hub / github.com/Lotus6/AutoRepeater / diff_prettyHtml

Method diff_prettyHtml

src/burp/Utils/diff_match_patch.java:1358–1378  ·  view source on GitHub ↗

Convert a Diff list into a pretty HTML report. @param diffs LinkedList of Diff objects. @return HTML representation.

(LinkedList<Diff> diffs)

Source from the content-addressed store, hash-verified

1356 * @return HTML representation.
1357 */
1358 public String diff_prettyHtml(LinkedList<Diff> diffs) {
1359 StringBuilder html = new StringBuilder();
1360 for (Diff aDiff : diffs) {
1361 String text = aDiff.text.replace("&", "&amp;").replace("<", "&lt;")
1362 .replace(">", "&gt;").replace("\n", "&para;<br>");
1363 switch (aDiff.operation) {
1364 case INSERT:
1365 html.append("<ins style=\"background:#e6ffe6;\">").append(text)
1366 .append("</ins>");
1367 break;
1368 case DELETE:
1369 html.append("<del style=\"background:#ffe6e6;\">").append(text)
1370 .append("</del>");
1371 break;
1372 case EQUAL:
1373 html.append("<span>").append(text).append("</span>");
1374 break;
1375 }
1376 }
1377 return html.toString();
1378 }
1379
1380 /**
1381 * Compute and return the source text (all equalities and deletions).

Callers

nothing calls this directly

Calls 1

toStringMethod · 0.45

Tested by

no test coverage detected