Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/wp-conte.../plugins/wp-file-.../lib/codemirr.../mode/gfm
File: gfm.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") // CommonJS
[4] Fix | Delete
mod(require("../../lib/codemirror"), require("../markdown/markdown"), require("../../addon/mode/overlay"));
[5] Fix | Delete
else if (typeof define == "function" && define.amd) // AMD
[6] Fix | Delete
define(["../../lib/codemirror", "../markdown/markdown", "../../addon/mode/overlay"], mod);
[7] Fix | Delete
else // Plain browser env
[8] Fix | Delete
mod(CodeMirror);
[9] Fix | Delete
})(function(CodeMirror) {
[10] Fix | Delete
"use strict";
[11] Fix | Delete
[12] Fix | Delete
var urlRE = /^((?:(?:aaas?|about|acap|adiumxtra|af[ps]|aim|apt|attachment|aw|beshare|bitcoin|bolo|callto|cap|chrome(?:-extension)?|cid|coap|com-eventbrite-attendee|content|crid|cvs|data|dav|dict|dlna-(?:playcontainer|playsingle)|dns|doi|dtn|dvb|ed2k|facetime|feed|file|finger|fish|ftp|geo|gg|git|gizmoproject|go|gopher|gtalk|h323|hcp|https?|iax|icap|icon|im|imap|info|ipn|ipp|irc[6s]?|iris(?:\.beep|\.lwz|\.xpc|\.xpcs)?|itms|jar|javascript|jms|keyparc|lastfm|ldaps?|magnet|mailto|maps|market|message|mid|mms|ms-help|msnim|msrps?|mtqp|mumble|mupdate|mvn|news|nfs|nih?|nntp|notes|oid|opaquelocktoken|palm|paparazzi|platform|pop|pres|proxy|psyc|query|res(?:ource)?|rmi|rsync|rtmp|rtsp|secondlife|service|session|sftp|sgn|shttp|sieve|sips?|skype|sm[bs]|snmp|soap\.beeps?|soldat|spotify|ssh|steam|svn|tag|teamspeak|tel(?:net)?|tftp|things|thismessage|tip|tn3270|tv|udp|unreal|urn|ut2004|vemmi|ventrilo|view-source|webcal|wss?|wtai|wyciwyg|xcon(?:-userid)?|xfire|xmlrpc\.beeps?|xmpp|xri|ymsgr|z39\.50[rs]?):(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]|\([^\s()<>]*\))+(?:\([^\s()<>]*\)|[^\s`*!()\[\]{};:'".,<>?«»“”‘’]))/i
[13] Fix | Delete
[14] Fix | Delete
CodeMirror.defineMode("gfm", function(config, modeConfig) {
[15] Fix | Delete
var codeDepth = 0;
[16] Fix | Delete
function blankLine(state) {
[17] Fix | Delete
state.code = false;
[18] Fix | Delete
return null;
[19] Fix | Delete
}
[20] Fix | Delete
var gfmOverlay = {
[21] Fix | Delete
startState: function() {
[22] Fix | Delete
return {
[23] Fix | Delete
code: false,
[24] Fix | Delete
codeBlock: false,
[25] Fix | Delete
ateSpace: false
[26] Fix | Delete
};
[27] Fix | Delete
},
[28] Fix | Delete
copyState: function(s) {
[29] Fix | Delete
return {
[30] Fix | Delete
code: s.code,
[31] Fix | Delete
codeBlock: s.codeBlock,
[32] Fix | Delete
ateSpace: s.ateSpace
[33] Fix | Delete
};
[34] Fix | Delete
},
[35] Fix | Delete
token: function(stream, state) {
[36] Fix | Delete
state.combineTokens = null;
[37] Fix | Delete
[38] Fix | Delete
// Hack to prevent formatting override inside code blocks (block and inline)
[39] Fix | Delete
if (state.codeBlock) {
[40] Fix | Delete
if (stream.match(/^```+/)) {
[41] Fix | Delete
state.codeBlock = false;
[42] Fix | Delete
return null;
[43] Fix | Delete
}
[44] Fix | Delete
stream.skipToEnd();
[45] Fix | Delete
return null;
[46] Fix | Delete
}
[47] Fix | Delete
if (stream.sol()) {
[48] Fix | Delete
state.code = false;
[49] Fix | Delete
}
[50] Fix | Delete
if (stream.sol() && stream.match(/^```+/)) {
[51] Fix | Delete
stream.skipToEnd();
[52] Fix | Delete
state.codeBlock = true;
[53] Fix | Delete
return null;
[54] Fix | Delete
}
[55] Fix | Delete
// If this block is changed, it may need to be updated in Markdown mode
[56] Fix | Delete
if (stream.peek() === '`') {
[57] Fix | Delete
stream.next();
[58] Fix | Delete
var before = stream.pos;
[59] Fix | Delete
stream.eatWhile('`');
[60] Fix | Delete
var difference = 1 + stream.pos - before;
[61] Fix | Delete
if (!state.code) {
[62] Fix | Delete
codeDepth = difference;
[63] Fix | Delete
state.code = true;
[64] Fix | Delete
} else {
[65] Fix | Delete
if (difference === codeDepth) { // Must be exact
[66] Fix | Delete
state.code = false;
[67] Fix | Delete
}
[68] Fix | Delete
}
[69] Fix | Delete
return null;
[70] Fix | Delete
} else if (state.code) {
[71] Fix | Delete
stream.next();
[72] Fix | Delete
return null;
[73] Fix | Delete
}
[74] Fix | Delete
// Check if space. If so, links can be formatted later on
[75] Fix | Delete
if (stream.eatSpace()) {
[76] Fix | Delete
state.ateSpace = true;
[77] Fix | Delete
return null;
[78] Fix | Delete
}
[79] Fix | Delete
if (stream.sol() || state.ateSpace) {
[80] Fix | Delete
state.ateSpace = false;
[81] Fix | Delete
if (modeConfig.gitHubSpice !== false) {
[82] Fix | Delete
if(stream.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+@)?(?:[a-f0-9]{7,40}\b)/)) {
[83] Fix | Delete
// User/Project@SHA
[84] Fix | Delete
// User@SHA
[85] Fix | Delete
// SHA
[86] Fix | Delete
state.combineTokens = true;
[87] Fix | Delete
return "link";
[88] Fix | Delete
} else if (stream.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+)?#[0-9]+\b/)) {
[89] Fix | Delete
// User/Project#Num
[90] Fix | Delete
// User#Num
[91] Fix | Delete
// #Num
[92] Fix | Delete
state.combineTokens = true;
[93] Fix | Delete
return "link";
[94] Fix | Delete
}
[95] Fix | Delete
}
[96] Fix | Delete
}
[97] Fix | Delete
if (stream.match(urlRE) &&
[98] Fix | Delete
stream.string.slice(stream.start - 2, stream.start) != "](" &&
[99] Fix | Delete
(stream.start == 0 || /\W/.test(stream.string.charAt(stream.start - 1)))) {
[100] Fix | Delete
// URLs
[101] Fix | Delete
// Taken from http://daringfireball.net/2010/07/improved_regex_for_matching_urls
[102] Fix | Delete
// And then (issue #1160) simplified to make it not crash the Chrome Regexp engine
[103] Fix | Delete
// And then limited url schemes to the CommonMark list, so foo:bar isn't matched as a URL
[104] Fix | Delete
state.combineTokens = true;
[105] Fix | Delete
return "link";
[106] Fix | Delete
}
[107] Fix | Delete
stream.next();
[108] Fix | Delete
return null;
[109] Fix | Delete
},
[110] Fix | Delete
blankLine: blankLine
[111] Fix | Delete
};
[112] Fix | Delete
[113] Fix | Delete
var markdownConfig = {
[114] Fix | Delete
underscoresBreakWords: false,
[115] Fix | Delete
taskLists: true,
[116] Fix | Delete
fencedCodeBlocks: '```',
[117] Fix | Delete
strikethrough: true
[118] Fix | Delete
};
[119] Fix | Delete
for (var attr in modeConfig) {
[120] Fix | Delete
markdownConfig[attr] = modeConfig[attr];
[121] Fix | Delete
}
[122] Fix | Delete
markdownConfig.name = "markdown";
[123] Fix | Delete
return CodeMirror.overlayMode(CodeMirror.getMode(config, markdownConfig), gfmOverlay);
[124] Fix | Delete
[125] Fix | Delete
}, "markdown");
[126] Fix | Delete
[127] Fix | Delete
CodeMirror.defineMIME("text/x-gfm", "gfm");
[128] Fix | Delete
});
[129] Fix | Delete
[130] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function