From 172d4cdcf2ba3206f2c4cdd9aa9a2489ba1f3c5a Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Thu, 8 Dec 2011 17:18:03 +0000 Subject: [PATCH] Added support for macros And added a dummy version macro to get started --- js/WikiTextMacros.js | 40 +++++++++++++++++++++++++++++++ js/WikiTextParser.js | 10 +++++++- test/wikitests/SecondTiddler.html | 2 +- test/wikitests/SecondTiddler.tid | 2 +- test/wikitests/SecondTiddler.txt | 2 +- 5 files changed, 52 insertions(+), 4 deletions(-) create mode 100644 js/WikiTextMacros.js diff --git a/js/WikiTextMacros.js b/js/WikiTextMacros.js new file mode 100644 index 000000000..afcf65117 --- /dev/null +++ b/js/WikiTextMacros.js @@ -0,0 +1,40 @@ +/* +Wiki text macro implementation +*/ + + +/*global require: false, exports: false */ +"use strict"; + +var util = require("util"); + +var wikiTextMacros = exports; + +wikiTextMacros.executeMacros = function(tree,store) { + for(var t=0; tHeadingThis is the second tiddler. It has a list:
And a and a custom class
\ No newline at end of file +

Heading

This is the second tiddler. It has a list:
And a macro invocation 0.0.0 and a custom class
\ No newline at end of file diff --git a/test/wikitests/SecondTiddler.tid b/test/wikitests/SecondTiddler.tid index ea4c4e246..05fef1b04 100644 --- a/test/wikitests/SecondTiddler.tid +++ b/test/wikitests/SecondTiddler.tid @@ -5,4 +5,4 @@ This is the second tiddler. It has a list: * Item one * Item two * Item three -And a <> and a {{myClass{custom class}}} +And a macro invocation <> and a {{myClass{custom class}}} diff --git a/test/wikitests/SecondTiddler.txt b/test/wikitests/SecondTiddler.txt index 95c66dcdc..efc2c9c39 100644 --- a/test/wikitests/SecondTiddler.txt +++ b/test/wikitests/SecondTiddler.txt @@ -1 +1 @@ -HeadingThis is the second tiddler. It has a list: Item one Item two Item threeAnd a and a custom class \ No newline at end of file +HeadingThis is the second tiddler. It has a list: Item one Item two Item threeAnd a macro invocation 0.0.0 and a custom class \ No newline at end of file