// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
var mode = CodeMirror.getMode({tabSize: 4}, 'textile');
function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); }
'[link "CodeMirror":http://codemirror.net]');
'[link "CodeMirror":code_mirror]',
'[link [[code_mirror]]http://codemirror.net]');
'foo bar[qualifier [[1]]]');
'Registered [tag (r)], ' +
'Trademark [tag (tm)], and ' +
'Copyright [tag (c)] 2008');
"A book is [keyword ??The Count of Monte Cristo??] by Dumas.");
MT('additionAndDeletion',
'The news networks declared [negative -Al Gore-] ' +
'[positive +George W. Bush+] the winner in Florida.');
'f(x, n) = log [builtin ~4~] x [builtin ^n^]');
'A [quote %span element%] and [atom @code element@]');
'Percentage 25% is not a span.');
'Question? is not a citation.');
'An image: [string !http://www.example.com/image.png!]');
'An image: [string !http://www.example.com/image.png (Alt Text)!]');
'An image: [string !http://www.example.com/image.png!:http://www.example.com/]');
'[header&header-1 h1. foo]');
'[header&header-2 h2. foo]');
'[header&header-3 h3. foo]');
'[header&header-4 h4. foo]');
'[header&header-5 h5. foo]');
'[header&header-6 h6. foo]');
'[header&header-1 h1. Heading 1]',
'[header&header-2 h2. Heading 2]',
'[header&header-1 h1. foo ][header&header-1&em _bar_][header&header-1 baz]');
'[variable-2 * ][variable-2&em _foo_][variable-2 bar]',
'[variable-2 * ][variable-2&strong *][variable-2&em&strong _foo_]' +
'[variable-2&strong *][variable-2 bar]',
'[variable-2 * ][variable-2&strong *foo*][variable-2 bar]');
'[variable-2 # ][variable-2&em _foo_][variable-2 bar]',
'[variable-2 # ][variable-2&strong *][variable-2&em&strong _foo_]' +
'[variable-2&strong *][variable-2 bar]',
'[variable-2 # ][variable-2&strong *foo*][variable-2 bar]');
'[number - coffee := Hot ][number&em _and_][number black]',
'[number Hot ][number&em _and_][number black =:]',
'[number - dog := woof woof]',
'[number - cat := meow meow]',
'[number Whale noises.]',
'[number Also, ][number&em _splashing_][number . =:]');
'[punctuation div][punctuation&attribute (#my-id)][punctuation . foo bar]');
MT('divWithAttributeAnd2emRightPadding',
'[punctuation div][punctuation&attribute (#my-id)((][punctuation . foo bar]');
'[punctuation div][punctuation&attribute (my-class#my-id)][punctuation . foo bar]');
'p[attribute {color:red;}]. foo bar');
MT('paragraphNestedStyles',
'p. [strong *foo ][strong&em _bar_][strong *]');
MT('paragraphWithLanguage',
'p[attribute [[fr]]]. Parlez-vous français?');
MT('paragraphRightAlign',
'p[attribute >]. Right');
MT('paragraphRightAlign',
'p[attribute =]. Center');
'p[attribute <>]. Justified');
MT('paragraphWithLeftIndent1em',
MT('paragraphWithRightIndent1em',
'p[attribute )]. Right');
MT('paragraphWithLeftIndent2em',
'p[attribute ((]. Left');
MT('paragraphWithRightIndent2em',
'p[attribute ))]. Right');
MT('paragraphWithLeftIndent3emRightIndent2em',
'p[attribute ((())]. Right');
'[punctuation div. ][punctuation&strong *foo ]' +
'[punctuation&strong&em _bar_][punctuation&strong *]');
MT('phraseModifierAttributes',
'p[attribute (my-class)]. This is a paragraph that has a class and' +
' this [em _][em&attribute (#special-phrase)][em emphasized phrase_]' +
'[link "(my-class). This is a link with class":http://redcloth.org]');
'p. This is one paragraph.',
'[punctuation div. foo bar]');
'[variable fn123. foo ][variable&strong *bar*]');
'[bracket bq.. foo bar]',
'[bracket bq.. foo bar]',
'[header&header-1 h1. Header Text]');
'[atom bc.. # Some ruby code]',
'[atom obj = {foo: :bar}]',
'[atom obj[[:love]] = "*love*"]',
'[atom puts obj.love.upcase]',
'[variable fn1.. foo bar]',
'[operator pre.. foo bar]',
'[variable-3&operator |_. name |_. age|]',
'[variable-3 |][variable-3&strong *Walter*][variable-3 | 5 |]',
'[variable-3 |Florence| 6 |]',
MT('tableWithAttributes',
'[variable-3&operator |_. name |_. age|]',
'[variable-3 |][variable-3&attribute /2.][variable-3 Jim |]',
'[variable-3 |][variable-3&attribute \\2{color: red}.][variable-3 Sam |]');
'[comment <div id="wrapper">]',
'[comment <section id="introduction">]',
'[header&header-1 h1. Welcome]',
'[variable-2 * Item one]',
'[variable-2 * Item two]',
'[comment <a href="http://example.com">Example</a>]',
'I can use HTML directly in my [comment <span class="youbetcha">Textile</span>].');
'[string-2 notextile. *No* formatting]');
'Use [string-2 ==*asterisks*==] for [strong *strong*] text.');
'[operator pre. *No* formatting]');
MT('notextileWithSpanningPre',
'[operator pre.. *No* formatting]',
'[operator *No* formatting]');
/* Only toggling phrases between non-word chars. */
'[negative -x-] aaa-bbb ccc-ddd [negative -eee-] fff [negative -ggg-]');