2012-06-02 08:41:21 +00:00
|
|
|
/*\
|
2012-06-02 08:54:00 +00:00
|
|
|
title: $:/core/modules/parsers/newwikitextparser/rules/codeblock.js
|
2012-06-02 08:41:21 +00:00
|
|
|
type: application/javascript
|
|
|
|
module-type: wikitextrule
|
|
|
|
|
|
|
|
Wiki text run rule for code blocks
|
|
|
|
|
|
|
|
\*/
|
|
|
|
(function(){
|
|
|
|
|
|
|
|
/*jslint node: true, browser: true */
|
|
|
|
/*global $tw: false */
|
|
|
|
"use strict";
|
|
|
|
|
2012-06-02 08:54:00 +00:00
|
|
|
exports.name = "codeblock";
|
2012-06-02 08:41:21 +00:00
|
|
|
|
|
|
|
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))];
|
|
|
|
};
|
|
|
|
|
|
|
|
})();
|