This commit is contained in:
harttle
2016-10-26 02:50:41 +08:00
parent 34f5cfa34d
commit 377c805230
14 changed files with 418 additions and 337 deletions
+4 -1
View File
@@ -1,9 +1,12 @@
const lexical = require('./lexical.js');
const TokenizationError = require('./error.js').TokenizationError;
const _ = require('./util/underscore.js');
function parse(html) {
var tokens = [];
if (!html) return tokens;
if (!_.isString(html)) {
throw new TokenizationError('illegal input type');
}
var syntax = /({%(.*?)%})|({{(.*?)}})/g;
var result, htmlFragment, token;