jquery-tmpl
                                
                                
                                
                                    jquery-tmpl copied to clipboard
                            
                            
                            
                        Please don't remove newline characters and remove newline character after }}
Although newline character is ignored in html, i want use jquery-templ to convert a text file. The newline character is important in the conversion result. And the newline after }} generate alot of blank lines in the result.
I improved it by modify fregment of function buildTmplFn() from
.replace( /(['])/g, "$1" ) .replace( /[\r\t\n]/g, " " ) .replace( /[\t]/g, " " ) .replace( /${([^}])}/g, "{{= $1}}" ) .replace( /{{(/?)(\w+|.)(?:(((?:[^}]|}(?!}))?)?))?(?:\s+(.?)?)?((((?:[^}]|}(?!}))?)))?\s*}}/g, function( all, slash, type, fnargs, target, parens, args ) { ...... }) +
to
.replace( /(['])/g, "$1" ) //.replace( /[\r\t\n]/g, " " ) .replace( /[\t]/g, " " ) .replace( /${([^}])}/g, "{{= $1}}" ) .replace( /{{(/?)(\w+|.)(?:(((?:[^}]|}(?!}))?)?))?(?:\s+(.?)?)?((((?:[^}]|}(?!}))?)))?\s_}}\s_/g, function( all, slash, type, fnargs, target, parens, args ) { ...... }).replace( /\r/g, "\r" ) .replace( /\n/g, "\n" ) +
Just suggestion because i used it in abnormal condication.
Thanks for taking the time to submit this issue. Just wanted to let you know this plugin is no longer being actively developed or maintained by the jQuery team. See README for more info.