kopia lustrzana https://github.com/miklobit/TiddlyWiki5
Added code blocks and runs
rodzic
a169980a54
commit
89b8e39f32
|
@ -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))];
|
||||
};
|
||||
|
||||
})();
|
|
@ -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))];
|
||||
};
|
||||
|
||||
})();
|
|
@ -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
|
||||
|
|
Ładowanie…
Reference in New Issue