source: node_modules/highlight.js/lib/languages/diff.js

main
Last change on this file was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago

Initial commit

  • Property mode set to 100644
File size: 1.5 KB
RevLine 
[d24f17c]1/*
2Language: Diff
3Description: Unified and context diff
4Author: Vasily Polovnyov <vast@whiteants.net>
5Website: https://www.gnu.org/software/diffutils/
6Category: common
7*/
8
9/** @type LanguageFn */
10function diff(hljs) {
11 return {
12 name: 'Diff',
13 aliases: ['patch'],
14 contains: [
15 {
16 className: 'meta',
17 relevance: 10,
18 variants: [
19 {
20 begin: /^@@ +-\d+,\d+ +\+\d+,\d+ +@@/
21 },
22 {
23 begin: /^\*\*\* +\d+,\d+ +\*\*\*\*$/
24 },
25 {
26 begin: /^--- +\d+,\d+ +----$/
27 }
28 ]
29 },
30 {
31 className: 'comment',
32 variants: [
33 {
34 begin: /Index: /,
35 end: /$/
36 },
37 {
38 begin: /^index/,
39 end: /$/
40 },
41 {
42 begin: /={3,}/,
43 end: /$/
44 },
45 {
46 begin: /^-{3}/,
47 end: /$/
48 },
49 {
50 begin: /^\*{3} /,
51 end: /$/
52 },
53 {
54 begin: /^\+{3}/,
55 end: /$/
56 },
57 {
58 begin: /^\*{15}$/
59 },
60 {
61 begin: /^diff --git/,
62 end: /$/
63 }
64 ]
65 },
66 {
67 className: 'addition',
68 begin: /^\+/,
69 end: /$/
70 },
71 {
72 className: 'deletion',
73 begin: /^-/,
74 end: /$/
75 },
76 {
77 className: 'addition',
78 begin: /^!/,
79 end: /$/
80 }
81 ]
82 };
83}
84
85module.exports = diff;
Note: See TracBrowser for help on using the repository browser.