예제 #1
0
 public void WhenCompileHtmlWithSingleQuotes_ThenSingleQuotesAreEscaped()
 {
     var compiler = new JQueryTmplCompiler();
     var result = compiler.Compile("<div id='a'></div>", new CompileContext());
     result.Output.ShouldEqual(
         @"function(jQuery, $item) {var $=jQuery,call,__=[],$data=$item.data;with($data){__.push('<div id=\'a\'></div>');}return __;}"
     );
 }
예제 #2
0
        public void WhenCompileHtmlWithSingleQuotes_ThenSingleQuotesAreEscaped()
        {
            var compiler = new JQueryTmplCompiler();
            var result   = compiler.Compile("<div id='a'></div>", new CompileContext());

            result.Output.ShouldEqual(
                @"function(jQuery, $item) {var $=jQuery,call,__=[],$data=$item.data;with($data){__.push('<div id=\'a\'></div>');}return __;}"
                );
        }