mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-09-18 18:29:42 +00:00
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();
|
||
|
};
|
||
|
|
||
|
})();
|