Skip to content

Commit

Permalink
https://github.com/SnakeskinTpl/Snakeskin/issues/78
Browse files Browse the repository at this point in the history
  • Loading branch information
kobezzza committed Aug 20, 2016
1 parent f98a282 commit 66b4171
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/compiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -643,16 +643,16 @@ Snakeskin.compile = function (src, opt_params, opt_info) {
// Directive is ended
} else if (el === rb && begin && !--begin) {
commandNameDecl = false;
const raw = command;
command = command.trim();

const
raw = command,
replacer = getReplacer(command);

command = command.trim();
if (!command) {
continue;
}

const
replacer = getReplacer(command);

if (replacer) {
command = replacer(command);
}
Expand Down
8 changes: 8 additions & 0 deletions test/tests/syntax/basic.ss
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ bar -1 1 foo foo 1 \1

{{ { /* hello */ }} /* world */ /** ! */ {{ /* 121 */ }} <div class="foo" bla-(( a ))="2" bar(( foo ))="3"></div>foo'bar' 3 `foo` {/*121 { <div bar="'}*/'" bla="'`121`'"></div>

[[directiveWithRegExpLiteral]]==========================================================================================

true false

========================================================================================================================

- namespace syntax[%fileName%]
Expand Down Expand Up @@ -95,3 +99,7 @@ bar -1 1 foo foo 1 \1
`{/*121`
{`{`}
< div bar = '`}*/`' | bla = '\`121\`'

- template directiveWithRegExpLiteral()
{output /123/.test('123')}
{ /\d+/.test('bla')}

0 comments on commit 66b4171

Please sign in to comment.