support multiline tags

This commit is contained in:
wojtask9
2017-04-10 11:58:45 +02:00
parent 20044c4256
commit 3bc7caa387
4 changed files with 19 additions and 4 deletions
+1 -1
View File
@@ -27,7 +27,7 @@ var hash = new RegExp(`(?:${identifier.source})\\s*:\\s*(?:${value.source})`);
var hashCapture = new RegExp(`(${identifier.source})\\s*:\\s*(${value.source})`, 'g');
// full match
var tagLine = new RegExp(`^\\s*(${identifier.source})\\s*(.*)\\s*$`);
var tagLine = new RegExp(`^\\s*(${identifier.source})\\s*([\\s\\S]*)\\s*$`);
var literalLine = new RegExp(`^${literal.source}$`, 'i');
var variableLine = new RegExp(`^${variable.source}$`);
var numberLine = new RegExp(`^${number.source}$`);
+1 -1
View File
@@ -9,7 +9,7 @@ function parse(html, filepath, options) {
html = whiteSpaceCtrl(html, options);
var tokens = [];
var syntax = /({%-?(.*?)-?%})|({{(.*?)}})/g;
var syntax = /({%-?([\s\S]*?)-?%})|({{([\s\S]*?)}})/g;
var result, htmlFragment, token;
var lastMatchEnd = 0, lastMatchBegin = -1, parsedLinesCount = 0;