|
|
|
|
@@ -96,7 +96,6 @@ describe('WikiAST serialization tests', function () {
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// Test case for commentblock rule
|
|
|
|
|
wiki.addTiddler({
|
|
|
|
|
title: 'CommentBlockTest',
|
|
|
|
|
text: '<!-- This is a comment -->\n\nSome text\n\n<!-- Another comment -->\n\nMore text',
|
|
|
|
|
@@ -106,7 +105,6 @@ describe('WikiAST serialization tests', function () {
|
|
|
|
|
expect(serialized).toBe(wiki.getTiddlerText('CommentBlockTest').trimEnd());
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// Test case for commentinline rule
|
|
|
|
|
wiki.addTiddler({
|
|
|
|
|
title: 'CommentInlineTest',
|
|
|
|
|
text: 'This is some text with an inline comment <!-- This is a comment --> and some more text.',
|
|
|
|
|
@@ -116,7 +114,6 @@ describe('WikiAST serialization tests', function () {
|
|
|
|
|
expect(serialized).toBe(wiki.getTiddlerText('CommentInlineTest').trimEnd());
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// Test case for conditional rule
|
|
|
|
|
wiki.addTiddler({
|
|
|
|
|
title: 'ConditionalTest',
|
|
|
|
|
text: 'This is a <% if [{something}] %>Elephant<% elseif [{else}] %>Pelican<% else %>Crocodile<% endif %>',
|
|
|
|
|
@@ -126,7 +123,6 @@ describe('WikiAST serialization tests', function () {
|
|
|
|
|
expect(serialized).toBe(wiki.getTiddlerText('ConditionalTest').trimEnd());
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// Test case for dash rule
|
|
|
|
|
wiki.addTiddler({
|
|
|
|
|
title: 'DashTest',
|
|
|
|
|
text: 'This is an en-dash: --\n\nThis is an em-dash: ---',
|
|
|
|
|
@@ -136,7 +132,6 @@ describe('WikiAST serialization tests', function () {
|
|
|
|
|
expect(serialized).toBe(wiki.getTiddlerText('DashTest').trimEnd());
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// Test case for entity rule
|
|
|
|
|
wiki.addTiddler({
|
|
|
|
|
title: 'EntityTest',
|
|
|
|
|
text: 'This is a copyright symbol: ©',
|
|
|
|
|
@@ -146,7 +141,6 @@ describe('WikiAST serialization tests', function () {
|
|
|
|
|
expect(serialized).toBe(wiki.getTiddlerText('EntityTest').trimEnd());
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// Test case for extlink rule
|
|
|
|
|
wiki.addTiddler({
|
|
|
|
|
title: 'ExtLinkTest',
|
|
|
|
|
text: 'An external link: https://www.tiddlywiki.com/\n\nA suppressed external link: ~http://www.tiddlyspace.com/',
|
|
|
|
|
@@ -156,7 +150,6 @@ describe('WikiAST serialization tests', function () {
|
|
|
|
|
expect(serialized).toBe(wiki.getTiddlerText('ExtLinkTest').trimEnd());
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// Test case for filteredtranscludeblock rule
|
|
|
|
|
wiki.addTiddler({
|
|
|
|
|
title: 'FilteredTranscludeBlockTest',
|
|
|
|
|
text: '{{{ [tag[docs]] }}}\n{{{ [tag[docs]] |tooltip}}}\n{{{ [tag[docs]] ||TemplateTitle}}}\n{{{ [tag[docs]] |tooltip||TemplateTitle}}}\n{{{ [tag[docs]] }}width:40;height:50;}.class.class',
|
|
|
|
|
@@ -166,7 +159,6 @@ describe('WikiAST serialization tests', function () {
|
|
|
|
|
expect(serialized).toBe(wiki.getTiddlerText('FilteredTranscludeBlockTest').trimEnd());
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// Test case for filteredtranscludeinline rule
|
|
|
|
|
wiki.addTiddler({
|
|
|
|
|
title: 'FilteredTranscludeInlineTest',
|
|
|
|
|
text: '{{{ [tag[docs]] }}} {{{ [tag[docs]] |tooltip}}} {{{ [tag[docs]] ||TemplateTitle}}} {{{ [tag[docs]] |tooltip||TemplateTitle}}} {{{ [tag[docs]] }}width:40;height:50;}.class.class',
|
|
|
|
|
@@ -185,8 +177,8 @@ describe('WikiAST serialization tests', function () {
|
|
|
|
|
var serialized = $tw.utils.serializeParseTree(wiki.parseTiddler('FunctionDefinition').tree).trimEnd();
|
|
|
|
|
expect(serialized).toBe(wiki.getTiddlerText('FunctionDefinition').trimEnd());
|
|
|
|
|
});
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
// Test case for hardlinebreaks rule
|
|
|
|
|
wiki.addTiddler({
|
|
|
|
|
title: 'HardLineBreaksTest',
|
|
|
|
|
text: '"""\nThis is some text\nThat is set like\nIt is a Poem\nWhen it is\nClearly\nNot\n"""\n',
|
|
|
|
|
@@ -196,7 +188,6 @@ describe('WikiAST serialization tests', function () {
|
|
|
|
|
expect(serialized).toBe(wiki.getTiddlerText('HardLineBreaksTest').trimEnd());
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// Test case for heading rule
|
|
|
|
|
wiki.addTiddler({
|
|
|
|
|
title: 'HeadingTest',
|
|
|
|
|
text: '! Heading 1\n!! Heading 2\n!!! Heading 3\n!!!! Heading 4\n!!!!! Heading 5\n!!!!!! Heading 6',
|
|
|
|
|
@@ -206,7 +197,6 @@ describe('WikiAST serialization tests', function () {
|
|
|
|
|
expect(serialized).toBe(wiki.getTiddlerText('HeadingTest').trimEnd());
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// Test case for html rule
|
|
|
|
|
wiki.addTiddler({
|
|
|
|
|
title: 'HtmlTest',
|
|
|
|
|
text: '<aside>\nThis is an HTML5 aside element\n</aside>\n\n<$slider target="MyTiddler">\nThis is a widget invocation\n</$slider>',
|
|
|
|
|
@@ -216,7 +206,6 @@ describe('WikiAST serialization tests', function () {
|
|
|
|
|
expect(serialized).toBe(wiki.getTiddlerText('HtmlTest').trimEnd());
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// Test case for image rule
|
|
|
|
|
wiki.addTiddler({
|
|
|
|
|
title: 'ImageTest',
|
|
|
|
|
text: '[img[https://tiddlywiki.com/fractalveg.jpg]]\n[img width=23 height=24 [https://tiddlywiki.com/fractalveg.jpg]]\n[img width={{!!width}} height={{!!height}} [https://tiddlywiki.com/fractalveg.jpg]]\n[img[Description of image|https://tiddlywiki.com/fractalveg.jpg]]\n[img[TiddlerTitle]]\n[img[Description of image|TiddlerTitle]]',
|
|
|
|
|
@@ -226,7 +215,6 @@ describe('WikiAST serialization tests', function () {
|
|
|
|
|
expect(serialized).toBe(wiki.getTiddlerText('ImageTest').trimEnd());
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// Test case for import rule
|
|
|
|
|
wiki.addTiddler({
|
|
|
|
|
title: 'ImportTest',
|
|
|
|
|
text: '\\import [[$:/core/ui/PageMacros]] [all[shadows+tiddlers]tag[$:/tags/Macro]!has[draft.of]]',
|
|
|
|
|
@@ -236,7 +224,6 @@ describe('WikiAST serialization tests', function () {
|
|
|
|
|
expect(serialized).toBe(wiki.getTiddlerText('ImportTest').trimEnd());
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// Test case for list rule
|
|
|
|
|
wiki.addTiddler({
|
|
|
|
|
title: 'ListTest',
|
|
|
|
|
text: '* This is an unordered list\n* It has two items\n\n# This is a numbered list\n## With a subitem\n# And a third item\n\n; This is a term that is being defined\n: This is the definition of that term\n\n#** One\n#* Two\n#** Three\n#**** Four\n#**# Five\n#**## Six\n## Seven\n### Eight\n## Nine\n\n* List item one\n*.active List item two has the class `active`\n* List item three',
|
|
|
|
|
@@ -246,7 +233,6 @@ describe('WikiAST serialization tests', function () {
|
|
|
|
|
expect(serialized).toBe(wiki.getTiddlerText('ListTest').trimEnd());
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// Test case for macrocallblock rule
|
|
|
|
|
wiki.addTiddler({
|
|
|
|
|
title: 'MacroCallBlockTest',
|
|
|
|
|
text: '<<name value value2>>',
|
|
|
|
|
@@ -256,7 +242,6 @@ describe('WikiAST serialization tests', function () {
|
|
|
|
|
expect(serialized).toBe(wiki.getTiddlerText('MacroCallBlockTest').trimEnd());
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// Test case for macrocallinline rule
|
|
|
|
|
wiki.addTiddler({
|
|
|
|
|
title: 'MacroCallInlineTest',
|
|
|
|
|
text: 'This is a macro call: <<name value value2>>',
|
|
|
|
|
@@ -266,7 +251,6 @@ describe('WikiAST serialization tests', function () {
|
|
|
|
|
expect(serialized).toBe(wiki.getTiddlerText('MacroCallInlineTest').trimEnd());
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// Test case for macrodef rule
|
|
|
|
|
wiki.addTiddler({
|
|
|
|
|
title: 'MacroDefTest',
|
|
|
|
|
text: '\\define name(param:defaultvalue,param2:defaultvalue)\ndefinition text, including $param$ markers\n\\end',
|
|
|
|
|
@@ -276,7 +260,6 @@ describe('WikiAST serialization tests', function () {
|
|
|
|
|
expect(serialized).toBe(wiki.getTiddlerText('MacroDefTest').trimEnd());
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// Test case for parameters rule
|
|
|
|
|
wiki.addTiddler({
|
|
|
|
|
title: 'ParametersTest',
|
|
|
|
|
text: '\\parameters(param:defaultvalue,param2:defaultvalue)',
|
|
|
|
|
@@ -286,7 +269,6 @@ describe('WikiAST serialization tests', function () {
|
|
|
|
|
expect(serialized).toBe(wiki.getTiddlerText('ParametersTest').trimEnd());
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// Test case for parsermode rule
|
|
|
|
|
wiki.addTiddler({
|
|
|
|
|
title: 'ParserModeTest',
|
|
|
|
|
text: '\\parsermode block\n\\parsermode inline',
|
|
|
|
|
@@ -296,7 +278,6 @@ describe('WikiAST serialization tests', function () {
|
|
|
|
|
expect(serialized).toBe(wiki.getTiddlerText('ParserModeTest').trimEnd());
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// Test case for prettyextlink rule
|
|
|
|
|
wiki.addTiddler({
|
|
|
|
|
title: 'PrettyExtLinkTest',
|
|
|
|
|
text: '[ext[https://tiddlywiki.com/fractalveg.jpg]]\n[ext[Tooltip|https://tiddlywiki.com/fractalveg.jpg]]',
|
|
|
|
|
@@ -306,7 +287,6 @@ describe('WikiAST serialization tests', function () {
|
|
|
|
|
expect(serialized).toBe(wiki.getTiddlerText('PrettyExtLinkTest').trimEnd());
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// Test case for prettylink rule
|
|
|
|
|
wiki.addTiddler({
|
|
|
|
|
title: 'PrettyLinkTest',
|
|
|
|
|
text: '[[Introduction]]\n[[Link description|TiddlerTitle]]',
|
|
|
|
|
|