aboutsummaryrefslogtreecommitdiff
path: root/imports/codemirror/mode/tiddlywiki/tiddlywiki.js
diff options
context:
space:
mode:
Diffstat (limited to 'imports/codemirror/mode/tiddlywiki/tiddlywiki.js')
-rw-r--r--imports/codemirror/mode/tiddlywiki/tiddlywiki.js28
1 files changed, 14 insertions, 14 deletions
diff --git a/imports/codemirror/mode/tiddlywiki/tiddlywiki.js b/imports/codemirror/mode/tiddlywiki/tiddlywiki.js
index 1d26967e..74fcd496 100644
--- a/imports/codemirror/mode/tiddlywiki/tiddlywiki.js
+++ b/imports/codemirror/mode/tiddlywiki/tiddlywiki.js
@@ -107,10 +107,10 @@ CodeMirror.defineMode("tiddlywiki", function (config, parserConfig) {
107 return ret('quote', 'quote'); 107 return ret('quote', 'quote');
108 } 108 }
109 if (stream.match(reWikiCommentStart) || stream.match(reWikiCommentStop)) { 109 if (stream.match(reWikiCommentStart) || stream.match(reWikiCommentStop)) {
110 return ret('code', 'code'); 110 return ret('code', 'comment');
111 } 111 }
112 if (stream.match(reJsCodeStart) || stream.match(reJsCodeStop) || stream.match(reXmlCodeStart) || stream.match(reXmlCodeStop)) { 112 if (stream.match(reJsCodeStart) || stream.match(reJsCodeStop) || stream.match(reXmlCodeStart) || stream.match(reXmlCodeStop)) {
113 return ret('code', 'code'); 113 return ret('code', 'comment');
114 } 114 }
115 if (stream.match(reHR)) { 115 if (stream.match(reHR)) {
116 return ret('hr', 'hr'); 116 return ret('hr', 'hr');
@@ -125,26 +125,26 @@ CodeMirror.defineMode("tiddlywiki", function (config, parserConfig) {
125 } 125 }
126 if (ch == "*") { // tw list 126 if (ch == "*") { // tw list
127 stream.eatWhile('*'); 127 stream.eatWhile('*');
128 return ret("list", "list"); 128 return ret("list", "comment");
129 } 129 }
130 if (ch == "#") { // tw numbered list 130 if (ch == "#") { // tw numbered list
131 stream.eatWhile('#'); 131 stream.eatWhile('#');
132 return ret("list", "list"); 132 return ret("list", "comment");
133 } 133 }
134 if (ch == ";") { // definition list, term 134 if (ch == ";") { // definition list, term
135 stream.eatWhile(';'); 135 stream.eatWhile(';');
136 return ret("list", "list"); 136 return ret("list", "comment");
137 } 137 }
138 if (ch == ":") { // definition list, description 138 if (ch == ":") { // definition list, description
139 stream.eatWhile(':'); 139 stream.eatWhile(':');
140 return ret("list", "list"); 140 return ret("list", "comment");
141 } 141 }
142 if (ch == ">") { // single line quote 142 if (ch == ">") { // single line quote
143 stream.eatWhile(">"); 143 stream.eatWhile(">");
144 return ret("quote", "quote"); 144 return ret("quote", "quote");
145 } 145 }
146 if (ch == '|') { 146 if (ch == '|') {
147 return ret('table', 'table'); 147 return ret('table', 'header');
148 } 148 }
149 } 149 }
150 150
@@ -155,7 +155,7 @@ CodeMirror.defineMode("tiddlywiki", function (config, parserConfig) {
155 // rudimentary html:// file:// link matching. TW knows much more ... 155 // rudimentary html:// file:// link matching. TW knows much more ...
156 if (/[hf]/i.test(ch)) { 156 if (/[hf]/i.test(ch)) {
157 if (/[ti]/i.test(stream.peek()) && stream.match(/\b(ttps?|tp|ile):\/\/[\-A-Z0-9+&@#\/%?=~_|$!:,.;]*[A-Z0-9+&@#\/%=~_|$]/i)) { 157 if (/[ti]/i.test(stream.peek()) && stream.match(/\b(ttps?|tp|ile):\/\/[\-A-Z0-9+&@#\/%?=~_|$!:,.;]*[A-Z0-9+&@#\/%=~_|$]/i)) {
158 return ret("link-external", "link-external"); 158 return ret("link", "link");
159 } 159 }
160 } 160 }
161 // just a little string indicator, don't want to have the whole string covered 161 // just a little string indicator, don't want to have the whole string covered
@@ -173,7 +173,7 @@ CodeMirror.defineMode("tiddlywiki", function (config, parserConfig) {
173 } 173 }
174 if (ch == "@") { // check for space link. TODO fix @@...@@ highlighting 174 if (ch == "@") { // check for space link. TODO fix @@...@@ highlighting
175 stream.eatWhile(isSpaceName); 175 stream.eatWhile(isSpaceName);
176 return ret("link-external", "link-external"); 176 return ret("link", "link");
177 } 177 }
178 if (/\d/.test(ch)) { // numbers 178 if (/\d/.test(ch)) { // numbers
179 stream.eatWhile(/\d/); 179 stream.eatWhile(/\d/);
@@ -266,21 +266,21 @@ CodeMirror.defineMode("tiddlywiki", function (config, parserConfig) {
266 var ch, sb = state.block; 266 var ch, sb = state.block;
267 267
268 if (sb && stream.current()) { 268 if (sb && stream.current()) {
269 return ret("code", "code"); 269 return ret("code", "comment");
270 } 270 }
271 271
272 if (!sb && stream.match(reUntilCodeStop)) { 272 if (!sb && stream.match(reUntilCodeStop)) {
273 state.tokenize = jsTokenBase; 273 state.tokenize = jsTokenBase;
274 return ret("code", "code-inline"); 274 return ret("code", "comment");
275 } 275 }
276 276
277 if (sb && stream.sol() && stream.match(reCodeBlockStop)) { 277 if (sb && stream.sol() && stream.match(reCodeBlockStop)) {
278 state.tokenize = jsTokenBase; 278 state.tokenize = jsTokenBase;
279 return ret("code", "code"); 279 return ret("code", "comment");
280 } 280 }
281 281
282 ch = stream.next(); 282 ch = stream.next();
283 return (sb) ? ret("code", "code") : ret("code", "code-inline"); 283 return (sb) ? ret("code", "comment") : ret("code", "comment");
284 } 284 }
285 285
286 // tw em / italic 286 // tw em / italic
@@ -324,7 +324,7 @@ CodeMirror.defineMode("tiddlywiki", function (config, parserConfig) {
324 } 324 }
325 maybeEnd = (ch == "-"); 325 maybeEnd = (ch == "-");
326 } 326 }
327 return ret("text", "line-through"); 327 return ret("text", "strikethrough");
328 } 328 }
329 329
330 // macro 330 // macro