Edit File by line
/home/barbar84/www/wp-conte.../plugins/wp-file-.../lib/codemirr.../mode/troff
File: troff.js
// CodeMirror, copyright (c) by Marijn Haverbeke and others
[0] Fix | Delete
// Distributed under an MIT license: http://codemirror.net/LICENSE
[1] Fix | Delete
[2] Fix | Delete
(function(mod) {
[3] Fix | Delete
if (typeof exports == "object" && typeof module == "object")
[4] Fix | Delete
mod(require("../../lib/codemirror"));
[5] Fix | Delete
else if (typeof define == "function" && define.amd)
[6] Fix | Delete
define(["../../lib/codemirror"], mod);
[7] Fix | Delete
else
[8] Fix | Delete
mod(CodeMirror);
[9] Fix | Delete
})(function(CodeMirror) {
[10] Fix | Delete
"use strict";
[11] Fix | Delete
[12] Fix | Delete
CodeMirror.defineMode('troff', function() {
[13] Fix | Delete
[14] Fix | Delete
var words = {};
[15] Fix | Delete
[16] Fix | Delete
function tokenBase(stream) {
[17] Fix | Delete
if (stream.eatSpace()) return null;
[18] Fix | Delete
[19] Fix | Delete
var sol = stream.sol();
[20] Fix | Delete
var ch = stream.next();
[21] Fix | Delete
[22] Fix | Delete
if (ch === '\\') {
[23] Fix | Delete
if (stream.match('fB') || stream.match('fR') || stream.match('fI') ||
[24] Fix | Delete
stream.match('u') || stream.match('d') ||
[25] Fix | Delete
stream.match('%') || stream.match('&')) {
[26] Fix | Delete
return 'string';
[27] Fix | Delete
}
[28] Fix | Delete
if (stream.match('m[')) {
[29] Fix | Delete
stream.skipTo(']');
[30] Fix | Delete
stream.next();
[31] Fix | Delete
return 'string';
[32] Fix | Delete
}
[33] Fix | Delete
if (stream.match('s+') || stream.match('s-')) {
[34] Fix | Delete
stream.eatWhile(/[\d-]/);
[35] Fix | Delete
return 'string';
[36] Fix | Delete
}
[37] Fix | Delete
if (stream.match('\(') || stream.match('*\(')) {
[38] Fix | Delete
stream.eatWhile(/[\w-]/);
[39] Fix | Delete
return 'string';
[40] Fix | Delete
}
[41] Fix | Delete
return 'string';
[42] Fix | Delete
}
[43] Fix | Delete
if (sol && (ch === '.' || ch === '\'')) {
[44] Fix | Delete
if (stream.eat('\\') && stream.eat('\"')) {
[45] Fix | Delete
stream.skipToEnd();
[46] Fix | Delete
return 'comment';
[47] Fix | Delete
}
[48] Fix | Delete
}
[49] Fix | Delete
if (sol && ch === '.') {
[50] Fix | Delete
if (stream.match('B ') || stream.match('I ') || stream.match('R ')) {
[51] Fix | Delete
return 'attribute';
[52] Fix | Delete
}
[53] Fix | Delete
if (stream.match('TH ') || stream.match('SH ') || stream.match('SS ') || stream.match('HP ')) {
[54] Fix | Delete
stream.skipToEnd();
[55] Fix | Delete
return 'quote';
[56] Fix | Delete
}
[57] Fix | Delete
if ((stream.match(/[A-Z]/) && stream.match(/[A-Z]/)) || (stream.match(/[a-z]/) && stream.match(/[a-z]/))) {
[58] Fix | Delete
return 'attribute';
[59] Fix | Delete
}
[60] Fix | Delete
}
[61] Fix | Delete
stream.eatWhile(/[\w-]/);
[62] Fix | Delete
var cur = stream.current();
[63] Fix | Delete
return words.hasOwnProperty(cur) ? words[cur] : null;
[64] Fix | Delete
}
[65] Fix | Delete
[66] Fix | Delete
function tokenize(stream, state) {
[67] Fix | Delete
return (state.tokens[0] || tokenBase) (stream, state);
[68] Fix | Delete
};
[69] Fix | Delete
[70] Fix | Delete
return {
[71] Fix | Delete
startState: function() {return {tokens:[]};},
[72] Fix | Delete
token: function(stream, state) {
[73] Fix | Delete
return tokenize(stream, state);
[74] Fix | Delete
}
[75] Fix | Delete
};
[76] Fix | Delete
});
[77] Fix | Delete
[78] Fix | Delete
CodeMirror.defineMIME('text/troff', 'troff');
[79] Fix | Delete
CodeMirror.defineMIME('text/x-troff', 'troff');
[80] Fix | Delete
CodeMirror.defineMIME('application/x-troff', 'troff');
[81] Fix | Delete
[82] Fix | Delete
});
[83] Fix | Delete
[84] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function