Commit eb4a437
Enhancement: Render tabs and spaces in pretty HTML previews. (#15)
Previously the `prettyHtml` functions made some changes to diff content
to better represent special characters, but not exhaustively. For
instance, it escapes `<` as `<` so that the HTML preview interprets
the content as plaintext and not as HTML. Similarly, it replaces the
LINE FEED character with `¶<br>` so that when interpreted by a
browser, the HTML will visually correspond to the newline (whereas HTML
parsers would normalize the whitespace and not show an actual newline).
This patch extends the existing transformation to represent horizontal
tabs with an ` ` EM SPACE and a space character with ` ` to
further highlight changes to these whitespace characters, rather than
having them blend in via whitespace normalization.
Co-authored-by: Dennis Snell <[email protected]>1 parent c32b811 commit eb4a437
File tree
10 files changed
+29
-10
lines changed- cpp
- csharp
- dart
- javascript
- java/src/name/fraser/neil/plaintext
- lua
- objectivec
- python2
- python3
10 files changed
+29
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
3 | 6 | | |
4 | 7 | | |
5 | 8 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1276 | 1276 | | |
1277 | 1277 | | |
1278 | 1278 | | |
1279 | | - | |
| 1279 | + | |
| 1280 | + | |
1280 | 1281 | | |
1281 | 1282 | | |
1282 | 1283 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1338 | 1338 | | |
1339 | 1339 | | |
1340 | 1340 | | |
1341 | | - | |
| 1341 | + | |
1342 | 1342 | | |
1343 | 1343 | | |
1344 | 1344 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1256 | 1256 | | |
1257 | 1257 | | |
1258 | 1258 | | |
1259 | | - | |
| 1259 | + | |
| 1260 | + | |
| 1261 | + | |
1260 | 1262 | | |
1261 | 1263 | | |
1262 | 1264 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1382 | 1382 | | |
1383 | 1383 | | |
1384 | 1384 | | |
1385 | | - | |
| 1385 | + | |
| 1386 | + | |
1386 | 1387 | | |
1387 | 1388 | | |
1388 | 1389 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1430 | 1430 | | |
1431 | 1431 | | |
1432 | 1432 | | |
| 1433 | + | |
| 1434 | + | |
1433 | 1435 | | |
1434 | 1436 | | |
1435 | 1437 | | |
1436 | | - | |
1437 | | - | |
| 1438 | + | |
| 1439 | + | |
| 1440 | + | |
| 1441 | + | |
| 1442 | + | |
| 1443 | + | |
| 1444 | + | |
1438 | 1445 | | |
1439 | 1446 | | |
1440 | 1447 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
| 61 | + | |
62 | 62 | | |
63 | | - | |
| 63 | + | |
| 64 | + | |
64 | 65 | | |
65 | 66 | | |
66 | 67 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1239 | 1239 | | |
1240 | 1240 | | |
1241 | 1241 | | |
| 1242 | + | |
| 1243 | + | |
1242 | 1244 | | |
1243 | 1245 | | |
1244 | 1246 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1071 | 1071 | | |
1072 | 1072 | | |
1073 | 1073 | | |
1074 | | - | |
| 1074 | + | |
| 1075 | + | |
1075 | 1076 | | |
1076 | 1077 | | |
1077 | 1078 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1069 | 1069 | | |
1070 | 1070 | | |
1071 | 1071 | | |
1072 | | - | |
| 1072 | + | |
| 1073 | + | |
1073 | 1074 | | |
1074 | 1075 | | |
1075 | 1076 | | |
| |||
0 commit comments