PageRenderTime 22ms CodeModel.GetById 15ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

/samples/scalate-presentation/src/highlight/languages/diff.js

http://github.com/scalate/scalate
JavaScript | 65 lines | 59 code | 1 blank | 5 comment | 0 complexity | f763fb355deddab5db92a82fbc036c8f MD5 | raw file
 1/*
 2Language: diff
 3Description: Unified and context diff
 4Author: Vasily Polovnyov <vast@whiteants.net>
 5*/
 6
 7hljs.LANGUAGES.diff = {
 8  case_insensitive: true,
 9  defaultMode: {
10    contains: ['chunk', 'header', 'addition', 'deletion', 'change']
11  },
12  modes: [
13    {
14      className: 'chunk',
15      begin: '^\\@\\@ +\\-\\d+,\\d+ +\\+\\d+,\\d+ +\\@\\@$', end:'^',
16      relevance: 10
17    },
18    {
19      className: 'chunk',
20      begin: '^\\*\\*\\* +\\d+,\\d+ +\\*\\*\\*\\*$', end: '^',
21      relevance: 10
22    },
23    {
24      className: 'chunk',
25      begin: '^\\-\\-\\- +\\d+,\\d+ +\\-\\-\\-\\-$', end: '^',
26      relevance: 10
27    },
28    {
29      className: 'header',
30      begin: 'Index: ', end: '$'
31    },
32    {
33      className: 'header',
34      begin: '=====', end: '=====$'
35    },
36    {
37      className: 'header',
38      begin: '^\\-\\-\\-', end: '$'
39    },
40    {
41      className: 'header',
42      begin: '^\\*{3} ', end: '$'
43    },
44    {
45      className: 'header',
46      begin: '^\\+\\+\\+', end: '$'
47    },
48    {
49      className: 'header',
50      begin: '\\*{5}', end: '\\*{5}$'
51    },
52    {
53      className: 'addition',
54      begin: '^\\+', end: '$'
55    },
56    {
57      className: 'deletion',
58      begin: '^\\-', end: '$'
59    },
60    {
61      className: 'change',
62      begin: '^\\!', end: '$'
63    }
64  ]
65};