refactor: use assert, fix: respect to express settings.views, close #16

This commit is contained in:
harttle
2016-11-03 00:43:23 +08:00
parent ce99bb56eb
commit f70b2ee203
25 changed files with 135 additions and 95 deletions
+2 -3
View File
@@ -1,12 +1,11 @@
const lexical = require('./lexical.js');
const TokenizationError = require('./util/error.js').TokenizationError;
const _ = require('./util/underscore.js');
const assert = require('../src/util/assert.js');
function parse(html) {
var tokens = [];
if (!_.isString(html)) {
throw new TokenizationError('illegal input type');
}
assert(_.isString(html), new TokenizationError('illegal input type'));
var syntax = /({%(.*?)%})|({{(.*?)}})/g;
var result, htmlFragment, token;