mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2026-10-04 23:21:42 +00:00
Added parser rule for HTML format comments
And try it out in the PageTemplate, which is getting pretty unintelligable
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
/*\
|
||||
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();
|
||||
};
|
||||
|
||||
})();
|
||||
Reference in New Issue
Block a user