diff --git a/core/modules/parsers/newwikitextparser/blockrules/code.js b/core/modules/parsers/newwikitextparser/blockrules/code.js new file mode 100644 index 000000000..6854e37f1 --- /dev/null +++ b/core/modules/parsers/newwikitextparser/blockrules/code.js @@ -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))]; +}; + +})(); diff --git a/core/modules/parsers/newwikitextparser/runrules/code.js b/core/modules/parsers/newwikitextparser/runrules/code.js new file mode 100644 index 000000000..177e1ec78 --- /dev/null +++ b/core/modules/parsers/newwikitextparser/runrules/code.js @@ -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))]; +}; + +})(); diff --git a/tw5.com/tiddlers/TestingNewWikiText.tid b/tw5.com/tiddlers/TestingNewWikiText.tid index 1691f31f7..37ea80643 100644 --- a/tw5.com/tiddlers/TestingNewWikiText.tid +++ b/tw5.com/tiddlers/TestingNewWikiText.tid @@ -13,6 +13,8 @@ Here's a paragraph with an embedded macro <> and that This will be mono }}} +And this will be {{{inline and monospaced}}}. + Here is a macro <> ! This is a new heading