mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-08-20 14:45:59 +00:00
![Jeremy Ruston](/assets/img/avatar_default.png)
Thus introducing a few functional regressions, but it's going to be easier to fix things up without the old code knocking around and getting in the way.
36 lines
778 B
JavaScript
36 lines
778 B
JavaScript
/*\
|
|
title: $:/core/modules/parsers/wikiparser/rules/commentblock.js
|
|
type: application/javascript
|
|
module-type: wikirule
|
|
|
|
Wiki text block rule for HTML comments. For example:
|
|
|
|
```
|
|
<!-- This is a comment -->
|
|
```
|
|
|
|
\*/
|
|
(function(){
|
|
|
|
/*jslint node: true, browser: true */
|
|
/*global $tw: false */
|
|
"use strict";
|
|
|
|
exports.name = "commentblock";
|
|
exports.types = {block: true};
|
|
|
|
exports.init = function(parser) {
|
|
this.parser = parser;
|
|
// Regexp to match - HTML comment regexp by Stephen Ostermiller, http://ostermiller.org/findhtmlcomment.html
|
|
this.matchRegExp = /\<![ \r\n\t]*(?:--(?:[^\-]|[\r\n]|-[^\-])*--[ \r\n\t]*)\>\r?\n/mg;
|
|
};
|
|
|
|
exports.parse = function() {
|
|
// Move past the match
|
|
this.parser.pos = this.matchRegExp.lastIndex;
|
|
// Don't return any elements
|
|
return [];
|
|
};
|
|
|
|
})();
|