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

def.snippet:param: #82

Closed
asins opened this issue Apr 29, 2013 · 4 comments
Closed

def.snippet:param: #82

asins opened this issue Apr 29, 2013 · 4 comments

Comments

@asins
Copy link

asins commented Apr 29, 2013

{{##def.snippet:param:
_{{=param.a}}param
#}}

{{#def.snippet:{a:12} }}

Result:
_12{a:12}

This is a bug, right should be _12param

@asins
Copy link
Author

asins commented Apr 29, 2013

c.use的replace方法做如下修改解决这个bug

                if (def[d] && def[d].arg && param) {
                    var rw = (d+":"+param).replace(/'|\\/g, '_');
                    def.__exp = def.__exp || {};
                    def.__exp[rw] = def[d].text.replace(new RegExp("(\\{\\{[\w=\\s!$]+?)" + def[code].arg + "([\\w.$\\s]+?\\}\\})", "g"), "$1" + param + "$2");
                    return s + "def.__exp['"+rw+"']";
                }

@whitingj
Copy link

I've run into this same bug and am having the same problem.

@epoberezkin
Copy link
Collaborator

@asins please see #195 (comment)
Please reopen if it is not answering the question

@epoberezkin
Copy link
Collaborator

Also #59

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

3 participants