Edit File by line
/home/barbar84/www/wp-conte.../plugins/wp-file-.../lib/codemirr.../mode/textile
File: test.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() {
[3] Fix | Delete
var mode = CodeMirror.getMode({tabSize: 4}, 'textile');
[4] Fix | Delete
function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); }
[5] Fix | Delete
[6] Fix | Delete
MT('simpleParagraphs',
[7] Fix | Delete
'Some text.',
[8] Fix | Delete
'',
[9] Fix | Delete
'Some more text.');
[10] Fix | Delete
[11] Fix | Delete
/*
[12] Fix | Delete
* Phrase Modifiers
[13] Fix | Delete
*/
[14] Fix | Delete
[15] Fix | Delete
MT('em',
[16] Fix | Delete
'foo [em _bar_]');
[17] Fix | Delete
[18] Fix | Delete
MT('emBoogus',
[19] Fix | Delete
'code_mirror');
[20] Fix | Delete
[21] Fix | Delete
MT('strong',
[22] Fix | Delete
'foo [strong *bar*]');
[23] Fix | Delete
[24] Fix | Delete
MT('strongBogus',
[25] Fix | Delete
'3 * 3 = 9');
[26] Fix | Delete
[27] Fix | Delete
MT('italic',
[28] Fix | Delete
'foo [em __bar__]');
[29] Fix | Delete
[30] Fix | Delete
MT('italicBogus',
[31] Fix | Delete
'code__mirror');
[32] Fix | Delete
[33] Fix | Delete
MT('bold',
[34] Fix | Delete
'foo [strong **bar**]');
[35] Fix | Delete
[36] Fix | Delete
MT('boldBogus',
[37] Fix | Delete
'3 ** 3 = 27');
[38] Fix | Delete
[39] Fix | Delete
MT('simpleLink',
[40] Fix | Delete
'[link "CodeMirror":http://codemirror.net]');
[41] Fix | Delete
[42] Fix | Delete
MT('referenceLink',
[43] Fix | Delete
'[link "CodeMirror":code_mirror]',
[44] Fix | Delete
'Normal Text.',
[45] Fix | Delete
'[link [[code_mirror]]http://codemirror.net]');
[46] Fix | Delete
[47] Fix | Delete
MT('footCite',
[48] Fix | Delete
'foo bar[qualifier [[1]]]');
[49] Fix | Delete
[50] Fix | Delete
MT('footCiteBogus',
[51] Fix | Delete
'foo bar[[1a2]]');
[52] Fix | Delete
[53] Fix | Delete
MT('special-characters',
[54] Fix | Delete
'Registered [tag (r)], ' +
[55] Fix | Delete
'Trademark [tag (tm)], and ' +
[56] Fix | Delete
'Copyright [tag (c)] 2008');
[57] Fix | Delete
[58] Fix | Delete
MT('cite',
[59] Fix | Delete
"A book is [keyword ??The Count of Monte Cristo??] by Dumas.");
[60] Fix | Delete
[61] Fix | Delete
MT('additionAndDeletion',
[62] Fix | Delete
'The news networks declared [negative -Al Gore-] ' +
[63] Fix | Delete
'[positive +George W. Bush+] the winner in Florida.');
[64] Fix | Delete
[65] Fix | Delete
MT('subAndSup',
[66] Fix | Delete
'f(x, n) = log [builtin ~4~] x [builtin ^n^]');
[67] Fix | Delete
[68] Fix | Delete
MT('spanAndCode',
[69] Fix | Delete
'A [quote %span element%] and [atom @code element@]');
[70] Fix | Delete
[71] Fix | Delete
MT('spanBogus',
[72] Fix | Delete
'Percentage 25% is not a span.');
[73] Fix | Delete
[74] Fix | Delete
MT('citeBogus',
[75] Fix | Delete
'Question? is not a citation.');
[76] Fix | Delete
[77] Fix | Delete
MT('codeBogus',
[78] Fix | Delete
'user@example.com');
[79] Fix | Delete
[80] Fix | Delete
MT('subBogus',
[81] Fix | Delete
'~username');
[82] Fix | Delete
[83] Fix | Delete
MT('supBogus',
[84] Fix | Delete
'foo ^ bar');
[85] Fix | Delete
[86] Fix | Delete
MT('deletionBogus',
[87] Fix | Delete
'3 - 3 = 0');
[88] Fix | Delete
[89] Fix | Delete
MT('additionBogus',
[90] Fix | Delete
'3 + 3 = 6');
[91] Fix | Delete
[92] Fix | Delete
MT('image',
[93] Fix | Delete
'An image: [string !http://www.example.com/image.png!]');
[94] Fix | Delete
[95] Fix | Delete
MT('imageWithAltText',
[96] Fix | Delete
'An image: [string !http://www.example.com/image.png (Alt Text)!]');
[97] Fix | Delete
[98] Fix | Delete
MT('imageWithUrl',
[99] Fix | Delete
'An image: [string !http://www.example.com/image.png!:http://www.example.com/]');
[100] Fix | Delete
[101] Fix | Delete
/*
[102] Fix | Delete
* Headers
[103] Fix | Delete
*/
[104] Fix | Delete
[105] Fix | Delete
MT('h1',
[106] Fix | Delete
'[header&header-1 h1. foo]');
[107] Fix | Delete
[108] Fix | Delete
MT('h2',
[109] Fix | Delete
'[header&header-2 h2. foo]');
[110] Fix | Delete
[111] Fix | Delete
MT('h3',
[112] Fix | Delete
'[header&header-3 h3. foo]');
[113] Fix | Delete
[114] Fix | Delete
MT('h4',
[115] Fix | Delete
'[header&header-4 h4. foo]');
[116] Fix | Delete
[117] Fix | Delete
MT('h5',
[118] Fix | Delete
'[header&header-5 h5. foo]');
[119] Fix | Delete
[120] Fix | Delete
MT('h6',
[121] Fix | Delete
'[header&header-6 h6. foo]');
[122] Fix | Delete
[123] Fix | Delete
MT('h7Bogus',
[124] Fix | Delete
'h7. foo');
[125] Fix | Delete
[126] Fix | Delete
MT('multipleHeaders',
[127] Fix | Delete
'[header&header-1 h1. Heading 1]',
[128] Fix | Delete
'',
[129] Fix | Delete
'Some text.',
[130] Fix | Delete
'',
[131] Fix | Delete
'[header&header-2 h2. Heading 2]',
[132] Fix | Delete
'',
[133] Fix | Delete
'More text.');
[134] Fix | Delete
[135] Fix | Delete
MT('h1inline',
[136] Fix | Delete
'[header&header-1 h1. foo ][header&header-1&em _bar_][header&header-1 baz]');
[137] Fix | Delete
[138] Fix | Delete
/*
[139] Fix | Delete
* Lists
[140] Fix | Delete
*/
[141] Fix | Delete
[142] Fix | Delete
MT('ul',
[143] Fix | Delete
'foo',
[144] Fix | Delete
'bar',
[145] Fix | Delete
'',
[146] Fix | Delete
'[variable-2 * foo]',
[147] Fix | Delete
'[variable-2 * bar]');
[148] Fix | Delete
[149] Fix | Delete
MT('ulNoBlank',
[150] Fix | Delete
'foo',
[151] Fix | Delete
'bar',
[152] Fix | Delete
'[variable-2 * foo]',
[153] Fix | Delete
'[variable-2 * bar]');
[154] Fix | Delete
[155] Fix | Delete
MT('ol',
[156] Fix | Delete
'foo',
[157] Fix | Delete
'bar',
[158] Fix | Delete
'',
[159] Fix | Delete
'[variable-2 # foo]',
[160] Fix | Delete
'[variable-2 # bar]');
[161] Fix | Delete
[162] Fix | Delete
MT('olNoBlank',
[163] Fix | Delete
'foo',
[164] Fix | Delete
'bar',
[165] Fix | Delete
'[variable-2 # foo]',
[166] Fix | Delete
'[variable-2 # bar]');
[167] Fix | Delete
[168] Fix | Delete
MT('ulFormatting',
[169] Fix | Delete
'[variable-2 * ][variable-2&em _foo_][variable-2 bar]',
[170] Fix | Delete
'[variable-2 * ][variable-2&strong *][variable-2&em&strong _foo_]' +
[171] Fix | Delete
'[variable-2&strong *][variable-2 bar]',
[172] Fix | Delete
'[variable-2 * ][variable-2&strong *foo*][variable-2 bar]');
[173] Fix | Delete
[174] Fix | Delete
MT('olFormatting',
[175] Fix | Delete
'[variable-2 # ][variable-2&em _foo_][variable-2 bar]',
[176] Fix | Delete
'[variable-2 # ][variable-2&strong *][variable-2&em&strong _foo_]' +
[177] Fix | Delete
'[variable-2&strong *][variable-2 bar]',
[178] Fix | Delete
'[variable-2 # ][variable-2&strong *foo*][variable-2 bar]');
[179] Fix | Delete
[180] Fix | Delete
MT('ulNested',
[181] Fix | Delete
'[variable-2 * foo]',
[182] Fix | Delete
'[variable-3 ** bar]',
[183] Fix | Delete
'[keyword *** bar]',
[184] Fix | Delete
'[variable-2 **** bar]',
[185] Fix | Delete
'[variable-3 ** bar]');
[186] Fix | Delete
[187] Fix | Delete
MT('olNested',
[188] Fix | Delete
'[variable-2 # foo]',
[189] Fix | Delete
'[variable-3 ## bar]',
[190] Fix | Delete
'[keyword ### bar]',
[191] Fix | Delete
'[variable-2 #### bar]',
[192] Fix | Delete
'[variable-3 ## bar]');
[193] Fix | Delete
[194] Fix | Delete
MT('ulNestedWithOl',
[195] Fix | Delete
'[variable-2 * foo]',
[196] Fix | Delete
'[variable-3 ## bar]',
[197] Fix | Delete
'[keyword *** bar]',
[198] Fix | Delete
'[variable-2 #### bar]',
[199] Fix | Delete
'[variable-3 ** bar]');
[200] Fix | Delete
[201] Fix | Delete
MT('olNestedWithUl',
[202] Fix | Delete
'[variable-2 # foo]',
[203] Fix | Delete
'[variable-3 ** bar]',
[204] Fix | Delete
'[keyword ### bar]',
[205] Fix | Delete
'[variable-2 **** bar]',
[206] Fix | Delete
'[variable-3 ## bar]');
[207] Fix | Delete
[208] Fix | Delete
MT('definitionList',
[209] Fix | Delete
'[number - coffee := Hot ][number&em _and_][number black]',
[210] Fix | Delete
'',
[211] Fix | Delete
'Normal text.');
[212] Fix | Delete
[213] Fix | Delete
MT('definitionListSpan',
[214] Fix | Delete
'[number - coffee :=]',
[215] Fix | Delete
'',
[216] Fix | Delete
'[number Hot ][number&em _and_][number black =:]',
[217] Fix | Delete
'',
[218] Fix | Delete
'Normal text.');
[219] Fix | Delete
[220] Fix | Delete
MT('boo',
[221] Fix | Delete
'[number - dog := woof woof]',
[222] Fix | Delete
'[number - cat := meow meow]',
[223] Fix | Delete
'[number - whale :=]',
[224] Fix | Delete
'[number Whale noises.]',
[225] Fix | Delete
'',
[226] Fix | Delete
'[number Also, ][number&em _splashing_][number . =:]');
[227] Fix | Delete
[228] Fix | Delete
/*
[229] Fix | Delete
* Attributes
[230] Fix | Delete
*/
[231] Fix | Delete
[232] Fix | Delete
MT('divWithAttribute',
[233] Fix | Delete
'[punctuation div][punctuation&attribute (#my-id)][punctuation . foo bar]');
[234] Fix | Delete
[235] Fix | Delete
MT('divWithAttributeAnd2emRightPadding',
[236] Fix | Delete
'[punctuation div][punctuation&attribute (#my-id)((][punctuation . foo bar]');
[237] Fix | Delete
[238] Fix | Delete
MT('divWithClassAndId',
[239] Fix | Delete
'[punctuation div][punctuation&attribute (my-class#my-id)][punctuation . foo bar]');
[240] Fix | Delete
[241] Fix | Delete
MT('paragraphWithCss',
[242] Fix | Delete
'p[attribute {color:red;}]. foo bar');
[243] Fix | Delete
[244] Fix | Delete
MT('paragraphNestedStyles',
[245] Fix | Delete
'p. [strong *foo ][strong&em _bar_][strong *]');
[246] Fix | Delete
[247] Fix | Delete
MT('paragraphWithLanguage',
[248] Fix | Delete
'p[attribute [[fr]]]. Parlez-vous français?');
[249] Fix | Delete
[250] Fix | Delete
MT('paragraphLeftAlign',
[251] Fix | Delete
'p[attribute <]. Left');
[252] Fix | Delete
[253] Fix | Delete
MT('paragraphRightAlign',
[254] Fix | Delete
'p[attribute >]. Right');
[255] Fix | Delete
[256] Fix | Delete
MT('paragraphRightAlign',
[257] Fix | Delete
'p[attribute =]. Center');
[258] Fix | Delete
[259] Fix | Delete
MT('paragraphJustified',
[260] Fix | Delete
'p[attribute <>]. Justified');
[261] Fix | Delete
[262] Fix | Delete
MT('paragraphWithLeftIndent1em',
[263] Fix | Delete
'p[attribute (]. Left');
[264] Fix | Delete
[265] Fix | Delete
MT('paragraphWithRightIndent1em',
[266] Fix | Delete
'p[attribute )]. Right');
[267] Fix | Delete
[268] Fix | Delete
MT('paragraphWithLeftIndent2em',
[269] Fix | Delete
'p[attribute ((]. Left');
[270] Fix | Delete
[271] Fix | Delete
MT('paragraphWithRightIndent2em',
[272] Fix | Delete
'p[attribute ))]. Right');
[273] Fix | Delete
[274] Fix | Delete
MT('paragraphWithLeftIndent3emRightIndent2em',
[275] Fix | Delete
'p[attribute ((())]. Right');
[276] Fix | Delete
[277] Fix | Delete
MT('divFormatting',
[278] Fix | Delete
'[punctuation div. ][punctuation&strong *foo ]' +
[279] Fix | Delete
'[punctuation&strong&em _bar_][punctuation&strong *]');
[280] Fix | Delete
[281] Fix | Delete
MT('phraseModifierAttributes',
[282] Fix | Delete
'p[attribute (my-class)]. This is a paragraph that has a class and' +
[283] Fix | Delete
' this [em _][em&attribute (#special-phrase)][em emphasized phrase_]' +
[284] Fix | Delete
' has an id.');
[285] Fix | Delete
[286] Fix | Delete
MT('linkWithClass',
[287] Fix | Delete
'[link "(my-class). This is a link with class":http://redcloth.org]');
[288] Fix | Delete
[289] Fix | Delete
/*
[290] Fix | Delete
* Layouts
[291] Fix | Delete
*/
[292] Fix | Delete
[293] Fix | Delete
MT('paragraphLayouts',
[294] Fix | Delete
'p. This is one paragraph.',
[295] Fix | Delete
'',
[296] Fix | Delete
'p. This is another.');
[297] Fix | Delete
[298] Fix | Delete
MT('div',
[299] Fix | Delete
'[punctuation div. foo bar]');
[300] Fix | Delete
[301] Fix | Delete
MT('pre',
[302] Fix | Delete
'[operator pre. Text]');
[303] Fix | Delete
[304] Fix | Delete
MT('bq.',
[305] Fix | Delete
'[bracket bq. foo bar]',
[306] Fix | Delete
'',
[307] Fix | Delete
'Normal text.');
[308] Fix | Delete
[309] Fix | Delete
MT('footnote',
[310] Fix | Delete
'[variable fn123. foo ][variable&strong *bar*]');
[311] Fix | Delete
[312] Fix | Delete
/*
[313] Fix | Delete
* Spanning Layouts
[314] Fix | Delete
*/
[315] Fix | Delete
[316] Fix | Delete
MT('bq..ThenParagraph',
[317] Fix | Delete
'[bracket bq.. foo bar]',
[318] Fix | Delete
'',
[319] Fix | Delete
'[bracket More quote.]',
[320] Fix | Delete
'p. Normal Text');
[321] Fix | Delete
[322] Fix | Delete
MT('bq..ThenH1',
[323] Fix | Delete
'[bracket bq.. foo bar]',
[324] Fix | Delete
'',
[325] Fix | Delete
'[bracket More quote.]',
[326] Fix | Delete
'[header&header-1 h1. Header Text]');
[327] Fix | Delete
[328] Fix | Delete
MT('bc..ThenParagraph',
[329] Fix | Delete
'[atom bc.. # Some ruby code]',
[330] Fix | Delete
'[atom obj = {foo: :bar}]',
[331] Fix | Delete
'[atom puts obj]',
[332] Fix | Delete
'',
[333] Fix | Delete
'[atom obj[[:love]] = "*love*"]',
[334] Fix | Delete
'[atom puts obj.love.upcase]',
[335] Fix | Delete
'',
[336] Fix | Delete
'p. Normal text.');
[337] Fix | Delete
[338] Fix | Delete
MT('fn1..ThenParagraph',
[339] Fix | Delete
'[variable fn1.. foo bar]',
[340] Fix | Delete
'',
[341] Fix | Delete
'[variable More.]',
[342] Fix | Delete
'p. Normal Text');
[343] Fix | Delete
[344] Fix | Delete
MT('pre..ThenParagraph',
[345] Fix | Delete
'[operator pre.. foo bar]',
[346] Fix | Delete
'',
[347] Fix | Delete
'[operator More.]',
[348] Fix | Delete
'p. Normal Text');
[349] Fix | Delete
[350] Fix | Delete
/*
[351] Fix | Delete
* Tables
[352] Fix | Delete
*/
[353] Fix | Delete
[354] Fix | Delete
MT('table',
[355] Fix | Delete
'[variable-3&operator |_. name |_. age|]',
[356] Fix | Delete
'[variable-3 |][variable-3&strong *Walter*][variable-3 | 5 |]',
[357] Fix | Delete
'[variable-3 |Florence| 6 |]',
[358] Fix | Delete
'',
[359] Fix | Delete
'p. Normal text.');
[360] Fix | Delete
[361] Fix | Delete
MT('tableWithAttributes',
[362] Fix | Delete
'[variable-3&operator |_. name |_. age|]',
[363] Fix | Delete
'[variable-3 |][variable-3&attribute /2.][variable-3 Jim |]',
[364] Fix | Delete
'[variable-3 |][variable-3&attribute \\2{color: red}.][variable-3 Sam |]');
[365] Fix | Delete
[366] Fix | Delete
/*
[367] Fix | Delete
* HTML
[368] Fix | Delete
*/
[369] Fix | Delete
[370] Fix | Delete
MT('html',
[371] Fix | Delete
'[comment <div id="wrapper">]',
[372] Fix | Delete
'[comment <section id="introduction">]',
[373] Fix | Delete
'',
[374] Fix | Delete
'[header&header-1 h1. Welcome]',
[375] Fix | Delete
'',
[376] Fix | Delete
'[variable-2 * Item one]',
[377] Fix | Delete
'[variable-2 * Item two]',
[378] Fix | Delete
'',
[379] Fix | Delete
'[comment <a href="http://example.com">Example</a>]',
[380] Fix | Delete
'',
[381] Fix | Delete
'[comment </section>]',
[382] Fix | Delete
'[comment </div>]');
[383] Fix | Delete
[384] Fix | Delete
MT('inlineHtml',
[385] Fix | Delete
'I can use HTML directly in my [comment <span class="youbetcha">Textile</span>].');
[386] Fix | Delete
[387] Fix | Delete
/*
[388] Fix | Delete
* No-Textile
[389] Fix | Delete
*/
[390] Fix | Delete
[391] Fix | Delete
MT('notextile',
[392] Fix | Delete
'[string-2 notextile. *No* formatting]');
[393] Fix | Delete
[394] Fix | Delete
MT('notextileInline',
[395] Fix | Delete
'Use [string-2 ==*asterisks*==] for [strong *strong*] text.');
[396] Fix | Delete
[397] Fix | Delete
MT('notextileWithPre',
[398] Fix | Delete
'[operator pre. *No* formatting]');
[399] Fix | Delete
[400] Fix | Delete
MT('notextileWithSpanningPre',
[401] Fix | Delete
'[operator pre.. *No* formatting]',
[402] Fix | Delete
'',
[403] Fix | Delete
'[operator *No* formatting]');
[404] Fix | Delete
[405] Fix | Delete
/* Only toggling phrases between non-word chars. */
[406] Fix | Delete
[407] Fix | Delete
MT('phrase-in-word',
[408] Fix | Delete
'foo_bar_baz');
[409] Fix | Delete
[410] Fix | Delete
MT('phrase-non-word',
[411] Fix | Delete
'[negative -x-] aaa-bbb ccc-ddd [negative -eee-] fff [negative -ggg-]');
[412] Fix | Delete
[413] Fix | Delete
MT('phrase-lone-dash',
[414] Fix | Delete
'foo - bar - baz');
[415] Fix | Delete
})();
[416] Fix | Delete
[417] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function