File tree 1 file changed +16
-1
lines changed
1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -82,8 +82,23 @@ Meteor.ui = Meteor.ui || {};
82
82
endNode === startNode . parentNode . nextSibling ) {
83
83
endNode = startNode . parentNode . lastChild ;
84
84
} else {
85
+ var r = new RegExp ( '<!--\\s*STARTRANGE_' + id + '.*?-->' , 'g' ) ;
86
+ var match = r . exec ( html ) ;
87
+ var help = "" ;
88
+ if ( match ) {
89
+ var comment_end = r . lastIndex ;
90
+ var comment_start = comment_end - match [ 0 ] . length ;
91
+ var stripped_before = html . slice ( 0 , comment_start ) . replace (
92
+ / < ! - - \s * ( S T A R T | E N D ) R A N G E .* ?- - > / g, '' ) ;
93
+ var stripped_after = html . slice ( comment_end ) . replace (
94
+ / < ! - - \s * ( S T A R T | E N D ) R A N G E .* ?- - > / g, '' ) ;
95
+ var context_amount = 50 ;
96
+ var context = stripped_before . slice ( - context_amount ) +
97
+ stripped_after . slice ( 0 , context_amount ) ;
98
+ help = " (possible unclosed near: " + context + ")" ;
99
+ }
85
100
throw new Error ( "Could not create liverange in template. " +
86
- "Check for unclosed tags in your HTML." ) ;
101
+ "Check for unclosed tags in your HTML." + help ) ;
87
102
}
88
103
}
89
104
You can’t perform that action at this time.
0 commit comments