UNPKG

747 BJavaScriptView Raw
1hljs.registerLanguage("diff",(()=>{"use strict";function e(...e){
2return"("+((e=>{const n=e[e.length-1]
3;return"object"==typeof n&&n.constructor===Object?(e.splice(e.length-1,1),n):{}
4})(e).capture?"":"?:")+e.map((e=>{return(n=e)?"string"==typeof n?n:n.source:null
5;var n})).join("|")+")"}return n=>({name:"Diff",aliases:["patch"],contains:[{
6className:"meta",relevance:10,
7match:e(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)
8},{className:"comment",variants:[{
9begin:e(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),
10end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{
11className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,
12end:/$/}]})})());
\No newline at end of file