mirror of
https://github.com/discourse/discourse.git
synced 2024-12-04 11:13:41 +08:00
9 lines
626 B
JavaScript
9 lines
626 B
JavaScript
hljs.registerLanguage("diff",(()=>{"use strict";return e=>({name:"Diff",
|
|
aliases:["patch"],contains:[{className:"meta",relevance:10,variants:[{
|
|
begin:/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/},{begin:/^\*\*\* +\d+,\d+ +\*\*\*\*$/},{
|
|
begin:/^--- +\d+,\d+ +----$/}]},{className:"comment",variants:[{begin:/Index: /,
|
|
end:/$/},{begin:/^index/,end:/$/},{begin:/={3,}/,end:/$/},{begin:/^-{3}/,end:/$/
|
|
},{begin:/^\*{3} /,end:/$/},{begin:/^\+{3}/,end:/$/},{begin:/^\*{15}$/},{
|
|
begin:/^diff --git/,end:/$/}]},{className:"addition",begin:/^\+/,end:/$/},{
|
|
className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,
|
|
end:/$/}]})})()); |