Skip to content

Commit

Permalink
fix #44
Browse files Browse the repository at this point in the history
  • Loading branch information
leeluolee committed Sep 29, 2015
1 parent 787683f commit 41d2700
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 11 deletions.
6 changes: 3 additions & 3 deletions dist/regular.js
Original file line number Diff line number Diff line change
Expand Up @@ -2476,12 +2476,12 @@ var rules = {
if(all) return {type: 'TEXT', value: all}
}],

ENTER_TAG: [/[^\x00<>]*?(?=<)/, function(all){
ENTER_TAG: [/[^\x00]*?(?=<[\w\/\!])/, function(all){
this.enter('TAG');
if(all) return {type: 'TEXT', value: all}
}],

TEXT: [/[^\x00]+/, 'TEXT'],
TEXT: [/[^\x00]+/, 'TEXT' ],

// 2. TAG
// --------------------
Expand Down Expand Up @@ -3974,7 +3974,7 @@ animate.inject = function( node, refer ,direction, callback ){
* @return {[type]} [description]
*/
animate.remove = function(node, callback){
if(!node) throw new Error('node to be removed is undefined')
if(!node) return;
var count = 0;
function loop(){
count++;
Expand Down
4 changes: 2 additions & 2 deletions dist/regular.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/helper/animate.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ animate.inject = function( node, refer ,direction, callback ){
* @return {[type]} [description]
*/
animate.remove = function(node, callback){
if(!node) throw new Error('node to be removed is undefined')
if(!node) return;
var count = 0;
function loop(){
count++;
Expand Down
4 changes: 2 additions & 2 deletions src/parser/Lexer.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,12 +239,12 @@ var rules = {
if(all) return {type: 'TEXT', value: all}
}],

ENTER_TAG: [/[^\x00<>]*?(?=<)/, function(all){
ENTER_TAG: [/[^\x00]*?(?=<[\w\/\!])/, function(all){
this.enter('TAG');
if(all) return {type: 'TEXT', value: all}
}],

TEXT: [/[^\x00]+/, 'TEXT'],
TEXT: [/[^\x00]+/, 'TEXT' ],

// 2. TAG
// --------------------
Expand Down
6 changes: 3 additions & 3 deletions test/regular.js
Original file line number Diff line number Diff line change
Expand Up @@ -2474,12 +2474,12 @@ var rules = {
if(all) return {type: 'TEXT', value: all}
}],

ENTER_TAG: [/[^\x00<>]*?(?=<)/, function(all){
ENTER_TAG: [/[^\x00]*?(?=<[\w\/\!])/, function(all){
this.enter('TAG');
if(all) return {type: 'TEXT', value: all}
}],

TEXT: [/[^\x00]+/, 'TEXT'],
TEXT: [/[^\x00]+/, 'TEXT' ],

// 2. TAG
// --------------------
Expand Down Expand Up @@ -3972,7 +3972,7 @@ animate.inject = function( node, refer ,direction, callback ){
* @return {[type]} [description]
*/
animate.remove = function(node, callback){
if(!node) throw new Error('node to be removed is undefined')
if(!node) return;
var count = 0;
function loop(){
count++;
Expand Down
12 changes: 12 additions & 0 deletions test/spec/browser-syntax.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,18 @@ void function(){

})

it("#44: <div>></div> should not throw error", function(){

expect(function(){
new Regular({template: '<div>></div>'})
}) .to.not.throwError();
expect(function(){
new Regular({template: '<div>><</div>'})
}) .to.not.throwError();

})





Expand Down

0 comments on commit 41d2700

Please sign in to comment.