You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
636 B
JavaScript
20 lines
636 B
JavaScript
7 years ago
|
CodeMirror.defineMode("changes", function() {
|
||
|
var headerSeperator = /^-+$/;
|
||
|
var headerLine = /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ?\d{1,2} \d{2}:\d{2}(:\d{2})? [A-Z]{3,4} \d{4} - /;
|
||
|
var simpleEmail = /^[\w+.-]+@[\w.-]+/;
|
||
|
|
||
|
return {
|
||
|
token: function(stream) {
|
||
|
if (stream.sol()) {
|
||
|
if (stream.match(headerSeperator)) { return 'tag'; }
|
||
|
if (stream.match(headerLine)) { return 'tag'; }
|
||
|
}
|
||
|
if (stream.match(simpleEmail)) { return 'string'; }
|
||
|
stream.next();
|
||
|
return null;
|
||
|
}
|
||
|
};
|
||
|
});
|
||
|
|
||
|
CodeMirror.defineMIME("text/x-rpm-changes", "changes");
|