Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please don't remove newline characters and remove newline character after }} #140

Open
manan6 opened this issue Aug 25, 2011 · 1 comment

Comments

@manan6
Copy link

manan6 commented Aug 25, 2011

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.

@rdworth
Copy link
Contributor

rdworth commented Oct 8, 2011

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants