mirror of
https://github.com/TiddlyWiki/TiddlyWiki5.git
synced 2026-04-27 17:24:48 +00:00
Stop using triple curly braces for code
We'll use triple curly braces for filtered transclusions, and require backtick for code.
This commit is contained in:
@@ -5,9 +5,9 @@ module-type: wikirule
|
||||
|
||||
Wiki text inline rule for code runs. For example:
|
||||
|
||||
{{{
|
||||
This is a {{{code run}}} and `so is this`.
|
||||
}}}
|
||||
```
|
||||
This is a `code run`.
|
||||
```
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
@@ -22,18 +22,13 @@ exports.types = {inline: true};
|
||||
exports.init = function(parser) {
|
||||
this.parser = parser;
|
||||
// Regexp to match
|
||||
this.matchRegExp = /(\{\{\{)|(`)/mg;
|
||||
this.matchRegExp = /`/mg;
|
||||
};
|
||||
|
||||
exports.parse = function() {
|
||||
// Move past the match
|
||||
this.parser.pos = this.matchRegExp.lastIndex;
|
||||
var reEnd;
|
||||
if(this.match[0] === "{{{") {
|
||||
reEnd = /(\}\}\})/mg;
|
||||
} else {
|
||||
reEnd = /(`)/mg;
|
||||
}
|
||||
var reEnd = /`/mg;
|
||||
// Look for the end marker
|
||||
reEnd.lastIndex = this.parser.pos;
|
||||
var match = reEnd.exec(this.parser.source),
|
||||
|
||||
Reference in New Issue
Block a user