mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-12-25 01:20:30 +00:00
Merge pull request #305 from Skeeve/issue_186
added a fix for issue #186
This commit is contained in:
commit
2ee5093944
@ -7,6 +7,7 @@ Wiki text inline rule for code runs. For example:
|
|||||||
|
|
||||||
```
|
```
|
||||||
This is a `code run`.
|
This is a `code run`.
|
||||||
|
This is another ``code run``
|
||||||
```
|
```
|
||||||
|
|
||||||
\*/
|
\*/
|
||||||
@ -22,13 +23,13 @@ exports.types = {inline: true};
|
|||||||
exports.init = function(parser) {
|
exports.init = function(parser) {
|
||||||
this.parser = parser;
|
this.parser = parser;
|
||||||
// Regexp to match
|
// Regexp to match
|
||||||
this.matchRegExp = /`/mg;
|
this.matchRegExp = /(``?)/mg;
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.parse = function() {
|
exports.parse = function() {
|
||||||
// Move past the match
|
// Move past the match
|
||||||
this.parser.pos = this.matchRegExp.lastIndex;
|
this.parser.pos = this.matchRegExp.lastIndex;
|
||||||
var reEnd = /`/mg;
|
var reEnd = new RegExp(this.match[1], "mg");
|
||||||
// Look for the end marker
|
// Look for the end marker
|
||||||
reEnd.lastIndex = this.parser.pos;
|
reEnd.lastIndex = this.parser.pos;
|
||||||
var match = reEnd.exec(this.parser.source),
|
var match = reEnd.exec(this.parser.source),
|
||||||
|
Loading…
Reference in New Issue
Block a user