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

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/wp-conte.../plugins/wp-file-.../lib/codemirr.../mode/markdown
File: markdown.js
var end = stream.string.indexOf(">", stream.pos);
[500] Fix | Delete
if (end != -1) {
[501] Fix | Delete
var atts = stream.string.substring(stream.start, end);
[502] Fix | Delete
if (/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(atts)) state.md_inside = true;
[503] Fix | Delete
}
[504] Fix | Delete
stream.backUp(1);
[505] Fix | Delete
state.htmlState = CodeMirror.startState(htmlMode);
[506] Fix | Delete
return switchBlock(stream, state, htmlBlock);
[507] Fix | Delete
}
[508] Fix | Delete
[509] Fix | Delete
if (ch === '<' && stream.match(/^\/\w*?>/)) {
[510] Fix | Delete
state.md_inside = false;
[511] Fix | Delete
return "tag";
[512] Fix | Delete
}
[513] Fix | Delete
[514] Fix | Delete
var ignoreUnderscore = false;
[515] Fix | Delete
if (!modeCfg.underscoresBreakWords) {
[516] Fix | Delete
if (ch === '_' && stream.peek() !== '_' && stream.match(/(\w)/, false)) {
[517] Fix | Delete
var prevPos = stream.pos - 2;
[518] Fix | Delete
if (prevPos >= 0) {
[519] Fix | Delete
var prevCh = stream.string.charAt(prevPos);
[520] Fix | Delete
if (prevCh !== '_' && prevCh.match(/(\w)/, false)) {
[521] Fix | Delete
ignoreUnderscore = true;
[522] Fix | Delete
}
[523] Fix | Delete
}
[524] Fix | Delete
}
[525] Fix | Delete
}
[526] Fix | Delete
if (ch === '*' || (ch === '_' && !ignoreUnderscore)) {
[527] Fix | Delete
if (sol && stream.peek() === ' ') {
[528] Fix | Delete
// Do nothing, surrounded by newline and space
[529] Fix | Delete
} else if (state.strong === ch && stream.eat(ch)) { // Remove STRONG
[530] Fix | Delete
if (modeCfg.highlightFormatting) state.formatting = "strong";
[531] Fix | Delete
var t = getType(state);
[532] Fix | Delete
state.strong = false;
[533] Fix | Delete
return t;
[534] Fix | Delete
} else if (!state.strong && stream.eat(ch)) { // Add STRONG
[535] Fix | Delete
state.strong = ch;
[536] Fix | Delete
if (modeCfg.highlightFormatting) state.formatting = "strong";
[537] Fix | Delete
return getType(state);
[538] Fix | Delete
} else if (state.em === ch) { // Remove EM
[539] Fix | Delete
if (modeCfg.highlightFormatting) state.formatting = "em";
[540] Fix | Delete
var t = getType(state);
[541] Fix | Delete
state.em = false;
[542] Fix | Delete
return t;
[543] Fix | Delete
} else if (!state.em) { // Add EM
[544] Fix | Delete
state.em = ch;
[545] Fix | Delete
if (modeCfg.highlightFormatting) state.formatting = "em";
[546] Fix | Delete
return getType(state);
[547] Fix | Delete
}
[548] Fix | Delete
} else if (ch === ' ') {
[549] Fix | Delete
if (stream.eat('*') || stream.eat('_')) { // Probably surrounded by spaces
[550] Fix | Delete
if (stream.peek() === ' ') { // Surrounded by spaces, ignore
[551] Fix | Delete
return getType(state);
[552] Fix | Delete
} else { // Not surrounded by spaces, back up pointer
[553] Fix | Delete
stream.backUp(1);
[554] Fix | Delete
}
[555] Fix | Delete
}
[556] Fix | Delete
}
[557] Fix | Delete
[558] Fix | Delete
if (modeCfg.strikethrough) {
[559] Fix | Delete
if (ch === '~' && stream.eatWhile(ch)) {
[560] Fix | Delete
if (state.strikethrough) {// Remove strikethrough
[561] Fix | Delete
if (modeCfg.highlightFormatting) state.formatting = "strikethrough";
[562] Fix | Delete
var t = getType(state);
[563] Fix | Delete
state.strikethrough = false;
[564] Fix | Delete
return t;
[565] Fix | Delete
} else if (stream.match(/^[^\s]/, false)) {// Add strikethrough
[566] Fix | Delete
state.strikethrough = true;
[567] Fix | Delete
if (modeCfg.highlightFormatting) state.formatting = "strikethrough";
[568] Fix | Delete
return getType(state);
[569] Fix | Delete
}
[570] Fix | Delete
} else if (ch === ' ') {
[571] Fix | Delete
if (stream.match(/^~~/, true)) { // Probably surrounded by space
[572] Fix | Delete
if (stream.peek() === ' ') { // Surrounded by spaces, ignore
[573] Fix | Delete
return getType(state);
[574] Fix | Delete
} else { // Not surrounded by spaces, back up pointer
[575] Fix | Delete
stream.backUp(2);
[576] Fix | Delete
}
[577] Fix | Delete
}
[578] Fix | Delete
}
[579] Fix | Delete
}
[580] Fix | Delete
[581] Fix | Delete
if (ch === ' ') {
[582] Fix | Delete
if (stream.match(/ +$/, false)) {
[583] Fix | Delete
state.trailingSpace++;
[584] Fix | Delete
} else if (state.trailingSpace) {
[585] Fix | Delete
state.trailingSpaceNewLine = true;
[586] Fix | Delete
}
[587] Fix | Delete
}
[588] Fix | Delete
[589] Fix | Delete
return getType(state);
[590] Fix | Delete
}
[591] Fix | Delete
[592] Fix | Delete
function linkInline(stream, state) {
[593] Fix | Delete
var ch = stream.next();
[594] Fix | Delete
[595] Fix | Delete
if (ch === ">") {
[596] Fix | Delete
state.f = state.inline = inlineNormal;
[597] Fix | Delete
if (modeCfg.highlightFormatting) state.formatting = "link";
[598] Fix | Delete
var type = getType(state);
[599] Fix | Delete
if (type){
[600] Fix | Delete
type += " ";
[601] Fix | Delete
} else {
[602] Fix | Delete
type = "";
[603] Fix | Delete
}
[604] Fix | Delete
return type + tokenTypes.linkInline;
[605] Fix | Delete
}
[606] Fix | Delete
[607] Fix | Delete
stream.match(/^[^>]+/, true);
[608] Fix | Delete
[609] Fix | Delete
return tokenTypes.linkInline;
[610] Fix | Delete
}
[611] Fix | Delete
[612] Fix | Delete
function linkHref(stream, state) {
[613] Fix | Delete
// Check if space, and return NULL if so (to avoid marking the space)
[614] Fix | Delete
if(stream.eatSpace()){
[615] Fix | Delete
return null;
[616] Fix | Delete
}
[617] Fix | Delete
var ch = stream.next();
[618] Fix | Delete
if (ch === '(' || ch === '[') {
[619] Fix | Delete
state.f = state.inline = getLinkHrefInside(ch === "(" ? ")" : "]", 0);
[620] Fix | Delete
if (modeCfg.highlightFormatting) state.formatting = "link-string";
[621] Fix | Delete
state.linkHref = true;
[622] Fix | Delete
return getType(state);
[623] Fix | Delete
}
[624] Fix | Delete
return 'error';
[625] Fix | Delete
}
[626] Fix | Delete
[627] Fix | Delete
var linkRE = {
[628] Fix | Delete
")": /^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,
[629] Fix | Delete
"]": /^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\\]]|\\.)*\])*?(?=\])/
[630] Fix | Delete
}
[631] Fix | Delete
[632] Fix | Delete
function getLinkHrefInside(endChar) {
[633] Fix | Delete
return function(stream, state) {
[634] Fix | Delete
var ch = stream.next();
[635] Fix | Delete
[636] Fix | Delete
if (ch === endChar) {
[637] Fix | Delete
state.f = state.inline = inlineNormal;
[638] Fix | Delete
if (modeCfg.highlightFormatting) state.formatting = "link-string";
[639] Fix | Delete
var returnState = getType(state);
[640] Fix | Delete
state.linkHref = false;
[641] Fix | Delete
return returnState;
[642] Fix | Delete
}
[643] Fix | Delete
[644] Fix | Delete
stream.match(linkRE[endChar])
[645] Fix | Delete
state.linkHref = true;
[646] Fix | Delete
return getType(state);
[647] Fix | Delete
};
[648] Fix | Delete
}
[649] Fix | Delete
[650] Fix | Delete
function footnoteLink(stream, state) {
[651] Fix | Delete
if (stream.match(/^([^\]\\]|\\.)*\]:/, false)) {
[652] Fix | Delete
state.f = footnoteLinkInside;
[653] Fix | Delete
stream.next(); // Consume [
[654] Fix | Delete
if (modeCfg.highlightFormatting) state.formatting = "link";
[655] Fix | Delete
state.linkText = true;
[656] Fix | Delete
return getType(state);
[657] Fix | Delete
}
[658] Fix | Delete
return switchInline(stream, state, inlineNormal);
[659] Fix | Delete
}
[660] Fix | Delete
[661] Fix | Delete
function footnoteLinkInside(stream, state) {
[662] Fix | Delete
if (stream.match(/^\]:/, true)) {
[663] Fix | Delete
state.f = state.inline = footnoteUrl;
[664] Fix | Delete
if (modeCfg.highlightFormatting) state.formatting = "link";
[665] Fix | Delete
var returnType = getType(state);
[666] Fix | Delete
state.linkText = false;
[667] Fix | Delete
return returnType;
[668] Fix | Delete
}
[669] Fix | Delete
[670] Fix | Delete
stream.match(/^([^\]\\]|\\.)+/, true);
[671] Fix | Delete
[672] Fix | Delete
return tokenTypes.linkText;
[673] Fix | Delete
}
[674] Fix | Delete
[675] Fix | Delete
function footnoteUrl(stream, state) {
[676] Fix | Delete
// Check if space, and return NULL if so (to avoid marking the space)
[677] Fix | Delete
if(stream.eatSpace()){
[678] Fix | Delete
return null;
[679] Fix | Delete
}
[680] Fix | Delete
// Match URL
[681] Fix | Delete
stream.match(/^[^\s]+/, true);
[682] Fix | Delete
// Check for link title
[683] Fix | Delete
if (stream.peek() === undefined) { // End of line, set flag to check next line
[684] Fix | Delete
state.linkTitle = true;
[685] Fix | Delete
} else { // More content on line, check if link title
[686] Fix | Delete
stream.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/, true);
[687] Fix | Delete
}
[688] Fix | Delete
state.f = state.inline = inlineNormal;
[689] Fix | Delete
return tokenTypes.linkHref + " url";
[690] Fix | Delete
}
[691] Fix | Delete
[692] Fix | Delete
var mode = {
[693] Fix | Delete
startState: function() {
[694] Fix | Delete
return {
[695] Fix | Delete
f: blockNormal,
[696] Fix | Delete
[697] Fix | Delete
prevLine: null,
[698] Fix | Delete
thisLine: null,
[699] Fix | Delete
[700] Fix | Delete
block: blockNormal,
[701] Fix | Delete
htmlState: null,
[702] Fix | Delete
indentation: 0,
[703] Fix | Delete
[704] Fix | Delete
inline: inlineNormal,
[705] Fix | Delete
text: handleText,
[706] Fix | Delete
[707] Fix | Delete
formatting: false,
[708] Fix | Delete
linkText: false,
[709] Fix | Delete
linkHref: false,
[710] Fix | Delete
linkTitle: false,
[711] Fix | Delete
code: 0,
[712] Fix | Delete
em: false,
[713] Fix | Delete
strong: false,
[714] Fix | Delete
header: 0,
[715] Fix | Delete
hr: false,
[716] Fix | Delete
taskList: false,
[717] Fix | Delete
list: false,
[718] Fix | Delete
listStack: [],
[719] Fix | Delete
quote: 0,
[720] Fix | Delete
trailingSpace: 0,
[721] Fix | Delete
trailingSpaceNewLine: false,
[722] Fix | Delete
strikethrough: false,
[723] Fix | Delete
fencedChars: null
[724] Fix | Delete
};
[725] Fix | Delete
},
[726] Fix | Delete
[727] Fix | Delete
copyState: function(s) {
[728] Fix | Delete
return {
[729] Fix | Delete
f: s.f,
[730] Fix | Delete
[731] Fix | Delete
prevLine: s.prevLine,
[732] Fix | Delete
thisLine: s.thisLine,
[733] Fix | Delete
[734] Fix | Delete
block: s.block,
[735] Fix | Delete
htmlState: s.htmlState && CodeMirror.copyState(htmlMode, s.htmlState),
[736] Fix | Delete
indentation: s.indentation,
[737] Fix | Delete
[738] Fix | Delete
localMode: s.localMode,
[739] Fix | Delete
localState: s.localMode ? CodeMirror.copyState(s.localMode, s.localState) : null,
[740] Fix | Delete
[741] Fix | Delete
inline: s.inline,
[742] Fix | Delete
text: s.text,
[743] Fix | Delete
formatting: false,
[744] Fix | Delete
linkTitle: s.linkTitle,
[745] Fix | Delete
code: s.code,
[746] Fix | Delete
em: s.em,
[747] Fix | Delete
strong: s.strong,
[748] Fix | Delete
strikethrough: s.strikethrough,
[749] Fix | Delete
header: s.header,
[750] Fix | Delete
hr: s.hr,
[751] Fix | Delete
taskList: s.taskList,
[752] Fix | Delete
list: s.list,
[753] Fix | Delete
listStack: s.listStack.slice(0),
[754] Fix | Delete
quote: s.quote,
[755] Fix | Delete
indentedCode: s.indentedCode,
[756] Fix | Delete
trailingSpace: s.trailingSpace,
[757] Fix | Delete
trailingSpaceNewLine: s.trailingSpaceNewLine,
[758] Fix | Delete
md_inside: s.md_inside,
[759] Fix | Delete
fencedChars: s.fencedChars
[760] Fix | Delete
};
[761] Fix | Delete
},
[762] Fix | Delete
[763] Fix | Delete
token: function(stream, state) {
[764] Fix | Delete
[765] Fix | Delete
// Reset state.formatting
[766] Fix | Delete
state.formatting = false;
[767] Fix | Delete
[768] Fix | Delete
if (stream != state.thisLine) {
[769] Fix | Delete
var forceBlankLine = state.header || state.hr;
[770] Fix | Delete
[771] Fix | Delete
// Reset state.header and state.hr
[772] Fix | Delete
state.header = 0;
[773] Fix | Delete
state.hr = false;
[774] Fix | Delete
[775] Fix | Delete
if (stream.match(/^\s*$/, true) || forceBlankLine) {
[776] Fix | Delete
blankLine(state);
[777] Fix | Delete
if (!forceBlankLine) return null
[778] Fix | Delete
state.prevLine = null
[779] Fix | Delete
}
[780] Fix | Delete
[781] Fix | Delete
state.prevLine = state.thisLine
[782] Fix | Delete
state.thisLine = stream
[783] Fix | Delete
[784] Fix | Delete
// Reset state.taskList
[785] Fix | Delete
state.taskList = false;
[786] Fix | Delete
[787] Fix | Delete
// Reset state.trailingSpace
[788] Fix | Delete
state.trailingSpace = 0;
[789] Fix | Delete
state.trailingSpaceNewLine = false;
[790] Fix | Delete
[791] Fix | Delete
state.f = state.block;
[792] Fix | Delete
var indentation = stream.match(/^\s*/, true)[0].replace(/\t/g, ' ').length;
[793] Fix | Delete
state.indentationDiff = Math.min(indentation - state.indentation, 4);
[794] Fix | Delete
state.indentation = state.indentation + state.indentationDiff;
[795] Fix | Delete
if (indentation > 0) return null;
[796] Fix | Delete
}
[797] Fix | Delete
return state.f(stream, state);
[798] Fix | Delete
},
[799] Fix | Delete
[800] Fix | Delete
innerMode: function(state) {
[801] Fix | Delete
if (state.block == htmlBlock) return {state: state.htmlState, mode: htmlMode};
[802] Fix | Delete
if (state.localState) return {state: state.localState, mode: state.localMode};
[803] Fix | Delete
return {state: state, mode: mode};
[804] Fix | Delete
},
[805] Fix | Delete
[806] Fix | Delete
blankLine: blankLine,
[807] Fix | Delete
[808] Fix | Delete
getType: getType,
[809] Fix | Delete
[810] Fix | Delete
fold: "markdown"
[811] Fix | Delete
};
[812] Fix | Delete
return mode;
[813] Fix | Delete
}, "xml");
[814] Fix | Delete
[815] Fix | Delete
CodeMirror.defineMIME("text/x-markdown", "markdown");
[816] Fix | Delete
[817] Fix | Delete
});
[818] Fix | Delete
[819] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function