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

Method diffToHtml

src/burp/Utils/HttpComparer.java:35–56  ·  view source on GitHub ↗
(LinkedList<diff_match_patch.Diff> diff)

Source from the content-addressed store, hash-verified

33 }
34
35 private static String diffToHtml(LinkedList<diff_match_patch.Diff> diff) {
36 StringBuilder html = new StringBuilder();
37 for (diff_match_patch.Diff aDiff : diff) {
38 String text = aDiff.text
39 .replace("&", "&amp;")
40 .replace("<", "&lt;")
41 .replace(">", "&gt;")
42 .replace("\n", "<br>");
43 switch (aDiff.operation) {
44 case INSERT:
45 html.append("<span style=\"background:#e6ffe6;\">").append(text).append("</span>");
46 break;
47 case DELETE:
48 html.append("<span style=\"background:#ffe6e6;\">").append(text).append("</span>");
49 break;
50 case EQUAL:
51 html.append("<span>").append(text).append("</span>");
52 break;
53 }
54 }
55 return html.toString();
56 }
57
58}

Callers 2

diffTextMethod · 0.95
diffLinesMethod · 0.95

Calls 1

toStringMethod · 0.45

Tested by

no test coverage detected