mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-09-19 10:49:43 +00:00
1f52b40cb6
And try it out in the PageTemplate, which is getting pretty unintelligable
34 lines
688 B
JavaScript
34 lines
688 B
JavaScript
/*\
|
|
title: $:/core/modules/parsers/newwikitextparser/rules/comment.js
|
|
type: application/javascript
|
|
module-type: wikitextrule
|
|
|
|
Wiki text run rule for HTML comments. For example:
|
|
|
|
{{{
|
|
<!-- This is a comment -->
|
|
}}}
|
|
|
|
\*/
|
|
(function(){
|
|
|
|
/*jslint node: true, browser: true */
|
|
/*global $tw: false */
|
|
"use strict";
|
|
|
|
exports.name = "comment";
|
|
|
|
exports.blockParser = true;
|
|
exports.runParser = true;
|
|
|
|
// Regexp by Stephen Ostermiller, http://ostermiller.org/findhtmlcomment.html
|
|
|
|
exports.regExpString = "\\<![ \\r\\n\\t]*(?:--(?:[^\\-]|[\\r\\n]|-[^\\-])*--[ \\r\\n\\t]*)\\>";
|
|
|
|
exports.parse = function(match,isBlock) {
|
|
this.pos = match.index + match[0].length;
|
|
return this.parseBlock();
|
|
};
|
|
|
|
})();
|