Skip to content

Commit

Permalink
fix #66
Browse files Browse the repository at this point in the history
  • Loading branch information
Zordius Chen committed Jul 7, 2014
1 parent 1ad39bb commit d9a9416
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lightncandy.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class LightnCandy {

// RegExps
const PARTIAL_SEARCH = '/\\{\\{>[ \\t]*(.+?)[ \\t]*\\}\\}/s';
const TOKEN_SEARCH = '/(\s*)(\\{{2,3})(~?)([\\^#\\/!]?)(.+?)(~?)(\\}{2,3})(\s*)/s';
const TOKEN_SEARCH = '/(\s*)(\\{{2,3})(~?)([\\^#\\/!&]?)(.+?)(~?)(\\}{2,3})(\s*)/s';
const VARNAME_SEARCH = '/(\\[[^\\]]+\\]|[^\\[\\]\\.]+)/';
const EXTENDED_COMMENT_SEARCH = '/{{!--.*?--}}/s';

Expand Down Expand Up @@ -1028,7 +1028,7 @@ protected static function parseTokenArgs(&$token, &$context) {
}
}

return Array(($token[self::POS_BEGINTAG] === '{{{'), $ret);
return Array(($token[self::POS_BEGINTAG] === '{{{') || ($token[self::POS_OP] === '&'), $ret);
}

/**
Expand Down Expand Up @@ -1065,7 +1065,7 @@ protected static function validateStartEnd($token, &$context, $raw) {
return true;
}
// {{{# }}} or {{{! }}} or {{{/ }}} or {{{^ }}} are invalid.
if ($raw && $token[self::POS_OP]) {
if ($raw && $token[self::POS_OP] && ($token[self::POS_OP] !== '&')) {
$context['error'][] = 'Bad token ' . self::tokenString($token) . ' ! Do you mean {{' . self::tokenString($token, 3) . '}} ?';
return true;
}
Expand Down

0 comments on commit d9a9416

Please sign in to comment.