Added code blocks and runs

print-window-tiddler
Jeremy Ruston 2012-06-02 09:41:21 +01:00
rodzic a169980a54
commit 89b8e39f32
3 zmienionych plików z 54 dodań i 0 usunięć

Wyświetl plik

@ -0,0 +1,26 @@
/*\
title: $:/core/modules/parsers/newwikitextparser/blockrules/code.js
type: application/javascript
module-type: wikitextrule
Wiki text run rule for code blocks
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
exports.name = "code";
exports.blockParser = true;
exports.regExpString = "\\{\\{\\{\\s*\\r?\\n";
exports.parse = function(match,isBlock) {
this.pos = match.index + match[0].length;
return [$tw.Tree.Element("pre",{},this.parseRun(/(\}\}\})/mg))];
};
})();

Wyświetl plik

@ -0,0 +1,26 @@
/*\
title: $:/core/modules/parsers/newwikitextparser/runrules/code.js
type: application/javascript
module-type: wikitextrule
Wiki text run rule for code runs
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
exports.name = "code";
exports.runParser = true;
exports.regExpString = "\\{\\{\\{";
exports.parse = function(match,isBlock) {
this.pos = match.index + match[0].length;
return [$tw.Tree.Element("code",{},this.parseRun(/(\}\}\})/mg))];
};
})();

Wyświetl plik

@ -13,6 +13,8 @@ Here's a paragraph with an embedded macro <<image "Motovun Jack.jpg">> and that
This will be mono
}}}
And this will be {{{inline and monospaced}}}.
Here is a macro <<list all>>
! This is a new heading