mirror of
https://github.com/TiddlyWiki/TiddlyWiki5.git
synced 2026-04-26 06:04:37 +00:00
Remove the old parser code
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.
This commit is contained in:
35
core/modules/parsers/wikiparser/rules/commentinline.js
Normal file
35
core/modules/parsers/wikiparser/rules/commentinline.js
Normal file
@@ -0,0 +1,35 @@
|
||||
/*\
|
||||
title: $:/core/modules/parsers/wikiparser/rules/commentinline.js
|
||||
type: application/javascript
|
||||
module-type: wikirule
|
||||
|
||||
Wiki text inline rule for HTML comments. For example:
|
||||
|
||||
```
|
||||
<!-- This is a comment -->
|
||||
```
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
exports.name = "commentinline";
|
||||
exports.types = {inline: 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]*)\>/mg;
|
||||
};
|
||||
|
||||
exports.parse = function() {
|
||||
// Move past the match
|
||||
this.parser.pos = this.matchRegExp.lastIndex;
|
||||
// Don't return any elements
|
||||
return [];
|
||||
};
|
||||
|
||||
})();
|
||||
Reference in New Issue
Block a user