瀏覽代碼

Style tweaks

tags/0.7.3
Michael Jackson 13 年之前
父節點
當前提交
320ae73475
共有 1 個檔案被更改,包括 8 行新增11 行删除
  1. +8
    -11
      mustache.js

+ 8
- 11
mustache.js 查看文件

@@ -398,7 +398,7 @@
nonSpace = false; nonSpace = false;
} }


var start, type, value, chr;
var start, type, value, chr, token;
while (!scanner.eos()) { while (!scanner.eos()) {
start = scanner.pos; start = scanner.pos;
value = scanner.scanUntil(tagRes[0]); value = scanner.scanUntil(tagRes[0]);
@@ -413,24 +413,21 @@
nonSpace = true; nonSpace = true;
} }


tokens.push(["text", chr, start, start + 1]);
tokens.push(['text', chr, start, start + 1]);
start += 1; start += 1;


if (chr === "\n") {
stripSpace(); // Check for whitespace on the current line.
}
// Check for whitespace on the current line.
if (chr == '\n') stripSpace();
} }
} }


start = scanner.pos; start = scanner.pos;


// Match the opening tag. // Match the opening tag.
if (!scanner.scan(tagRes[0])) {
break;
}

if (!scanner.scan(tagRes[0])) break;
hasTag = true; hasTag = true;
type = scanner.scan(tagRe) || "name";

type = scanner.scan(tagRe) || 'name';


// Skip any whitespace between tag and value. // Skip any whitespace between tag and value.
scanner.scan(whiteRe); scanner.scan(whiteRe);
@@ -468,7 +465,7 @@
} }
} }


var token = [type, value, start, scanner.pos];
token = [type, value, start, scanner.pos];
tokens.push(token); tokens.push(token);


if (type === '#' || type === '^') { if (type === '#' || type === '^') {


Loading…
取消
儲存