-
Notifications
You must be signed in to change notification settings - Fork 9
/
test-mismatchedwidth.html
127 lines (118 loc) · 1.96 KB
/
test-mismatchedwidth.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
<!doctype html>
<html>
<head>
<!-- A web font both looks nice and ensures consistent pixels across platforms.
It's not necessary for codediff.js to function, however. Any font will do. -->
<link href='http://fonts.googleapis.com/css?family=Inconsolata' rel='stylesheet' type='text/css'>
<link rel=stylesheet href="codediff.css">
<style>
.line-no, .code {
font-family: Courier;
font-size: small;
}
</style>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
</head>
<body>
<p>Here's a sample diff rendered with codediff.js:</p>
<div id="diffview">
</div>
<script src="difflib.js"></script>
<script src="dist/codediff.js"></script>
<script type="text/javascript">
function renderDiff(diffDiv, contentsBefore, contentsAfter) {
diffDiv.appendChild(codediff.buildView(contentsBefore, contentsAfter, {
beforeName: 'Short Rows',
afterName: 'Long Rows',
wordWrap: true,
minJumpSize: 0
}));
}
</script>
<script type="notjavascript" id="before">Hello
Hello
Hello
Hello
Hello
Hello
Hello
Hello
Hello
to the World of Tomorrow
Here's a line with a difference that's
How's it going?
I'm going to delete this.
Line A
Line B
Line C
Line D
Line E
Line F
Line G
Line H
Line I
Line J
Line K
Line L
Line M
Line N
Line O
Line P
Line Q
Line R
Line S
Line T
Line U
Line V
Line W
Line X
Line Y
Line Z
</script>
<script type="notjavascript" id="after">Hello
Hello
Hello
Hello
Hello
Hello
Hello
Hello
Hello
to the Words of Tomorrow
Here's a line with a difference that's "hard" to spot without char-by-char diffs
How's it going?
Line A
Line B
Line B2
Line C
Line D
Line E
Line F
Line G
Line H
Line I
Line J
Line K
> Line L2
Line M
Line N
Line O
Line Q
Line R
Line S
Line T
Line U
Line V
Line W
Line X
Line Y
Line Z
</script>
<script type="text/javascript">
var beforeText = $("#before").html();
var afterText = $("#after").html();
var diffDiv = $("#diffview").get(0);
renderDiff(diffDiv, beforeText, afterText);
</script>
</body>
</html>